lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1483718362-18147-1-git-send-email-jlayton@redhat.com>
Date:   Fri,  6 Jan 2017 10:59:22 -0500
From:   Jeff Layton <jlayton@...hat.com>
To:     Al Viro <viro@....linux.org.uk>
Cc:     linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] iov_iter: add missing handling for ITER_KVEC in iov_iter_single_seg_count

This seems to currently work by happenstance since kvec and iovec fields
basically the same, but it's probably better to make this explicit.

Signed-off-by: Jeff Layton <jlayton@...hat.com>
---
 lib/iov_iter.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/iov_iter.c b/lib/iov_iter.c
index f2bd21b93dfc..6b415b5a100d 100644
--- a/lib/iov_iter.c
+++ b/lib/iov_iter.c
@@ -738,6 +738,8 @@ size_t iov_iter_single_seg_count(const struct iov_iter *i)
 		return i->count;
 	else if (i->type & ITER_BVEC)
 		return min(i->count, i->bvec->bv_len - i->iov_offset);
+	else if (i->type & ITER_KVEC)
+		return min(i->count, i->kvec->iov_len - i->iov_offset);
 	else
 		return min(i->count, i->iov->iov_len - i->iov_offset);
 }
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ