From: Christoph Hellwig <hch@lst.de>
To: Hans Holmberg <hans.holmberg@wdc.com>
Cc: Jens Axboe <axboe@kernel.dk>,
linux-block@vger.kernel.org, Keith Busch <kbusch@kernel.org>,
Damien Le Moal <dlemoal@kernel.org>,
Johannes Thumshirn <johannes.thumshirn@wdc.com>,
Christoph Hellwig <hch@lst.de>,
Shinichiro Kawasaki <shinichiro.kawasaki@wdc.com>,
Andreas Hindborg <a.hindborg@kernel.org>
Subject: Re: [PATCH v3] null_blk: set dma alignment to logical block size
Date: Fri, 31 Oct 2025 10:36:30 +0100 [thread overview]
Message-ID: <20251031093630.GA9957@lst.de> (raw)
In-Reply-To: <20251031093546.134229-1-hans.holmberg@wdc.com>
On Fri, Oct 31, 2025 at 10:35:46AM +0100, Hans Holmberg wrote:
> This driver assumes that bio vectors are memory aligned to the logical
> block size, so set the queue limit to reflect that.
>
> Unless we set up the limit based on the logical block size, we will go
> out of page bounds in copy_to_nullb / copy_from_nullb.
>
> Apparently this wasn't noticed so far because none of the tests generate
> such buffers, but since commit 851c4c96db00 ("xfs: implement
> XFS_IOC_DIOINFO in terms of vfs_getattr") xfstests generates unaligned
> I/O, which now lead to memory corruption when using null_blk devices
> with 4k block size.
>
> Fixes: bf8d08532bc1 ("iomap: add support for dma aligned direct-io")
> Fixes: b1a000d3b8ec ("block: relax direct io memory alignment")
> Signed-off-by: Hans Holmberg <hans.holmberg@wdc.com>
Still no reviewed-by tag seen. But just for the record:
Reviewed-by: Christoph Hellwig <hch@lst.de>
prev parent reply other threads:[~2025-10-31 9:36 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-31 9:35 [PATCH v3] null_blk: set dma alignment to logical block size Hans Holmberg
2025-10-31 9:36 ` Christoph Hellwig [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251031093630.GA9957@lst.de \
--to=hch@lst.de \
--cc=a.hindborg@kernel.org \
--cc=axboe@kernel.dk \
--cc=dlemoal@kernel.org \
--cc=hans.holmberg@wdc.com \
--cc=johannes.thumshirn@wdc.com \
--cc=kbusch@kernel.org \
--cc=linux-block@vger.kernel.org \
--cc=shinichiro.kawasaki@wdc.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.