[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20250416165512.990257538f61be5857e513ab@linux-foundation.org>
Date: Wed, 16 Apr 2025 16:55:12 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: Nitesh Shetty <nj.shetty@...sung.com>
Cc: Alexander Viro <viro@...iv.linux.org.uk>, axboe@...nel.dk,
gost.dev@...sung.com, nitheshshetty@...il.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] iov_iter: Use iov_offset for length calculation in
iov_iter_aligned_bvec
On Tue, 15 Apr 2025 23:44:19 +0530 Nitesh Shetty <nj.shetty@...sung.com> wrote:
> 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.
>
Please describe the userspace-visible effects of this flaw, if any?
> --- 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;
>
Powered by blists - more mailing lists