Re: [PATCH v3 5/5] block: validate user space vectors during extraction

Hannes Reinecke <[email protected]>
Newsgroups dev.linux.lists.dm-devel,org.kernel.vger.linux-block,org.kernel.vger.linux-fsdevel,org.kernel.vger.stable
Message-ID <[email protected]>
On 6/24/26 7:09 PM, Keith Busch wrote:
> From: Keith Busch <[email protected]>
> 
> The bio-based drivers don't necessarily check the alignment split, and
> stacking block drivers don't always handle a misalignment detected after
> submitting the bio. Validate user vectors against the device's
> dma_alignment as the bio is built from the iov_iter, rejecting
> misaligned early with -EINVAL.
> 
> Cc: [email protected]
> Fixes: 5ff3f74e145a ("block: simplify direct io validity check")
> Fixes: 7eac33186957 ("iomap: simplify direct io validity check")
> Signed-off-by: Keith Busch <[email protected]>
> ---
>   block/bio.c          | 56 +++++++++++++++++++++++++++++++++++++++++---
>   block/blk-map.c      |  2 +-
>   block/fops.c         |  2 +-
>   fs/iomap/direct-io.c |  1 +
>   include/linux/bio.h  |  2 +-
>   include/linux/uio.h  | 10 +++++++-
>   lib/iov_iter.c       |  9 ++++++-
>   7 files changed, 74 insertions(+), 8 deletions(-)
> 
Reviewed-by: Hannes Reinecke <[email protected]>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke                  Kernel Storage Architect
[email protected]                                +49 911 74053 688
SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg
HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.