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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250415181419.16305-1-nj.shetty@samsung.com>
Date: Tue, 15 Apr 2025 23:44:19 +0530
From: Nitesh Shetty <nj.shetty@...sung.com>
To: Alexander Viro <viro@...iv.linux.org.uk>, Andrew Morton
	<akpm@...ux-foundation.org>
Cc: axboe@...nel.dk, gost.dev@...sung.com, nitheshshetty@...il.com, Nitesh
	Shetty <nj.shetty@...sung.com>, linux-kernel@...r.kernel.org
Subject: [PATCH] iov_iter: Use iov_offset for length calculation in
 iov_iter_aligned_bvec

If iov_offset is non-zero, then we need to consider iov_offset in length
calculation, otherwise we might pass smaller IOs such as 512 bytes
with 256 bytes offset.

Signed-off-by: Nitesh Shetty <nj.shetty@...sung.com>
---
 lib/iov_iter.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/iov_iter.c b/lib/iov_iter.c
index 8c7fdb7d8c8f..aa80fb094004 100644
--- a/lib/iov_iter.c
+++ b/lib/iov_iter.c
@@ -820,7 +820,7 @@ static bool iov_iter_aligned_bvec(const struct iov_iter *i, unsigned addr_mask,
 	size_t size = i->count;
 
 	do {
-		size_t len = bvec->bv_len;
+		size_t len = bvec->bv_len - skip;
 
 		if (len > size)
 			len = size;

base-commit: 834a4a689699090a406d1662b03affa8b155d025
-- 
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ