Re: [PATCH RESEND 5/5] block: validate user space vectors during extraction
Shin'ichiro Kawasaki <[email protected]> Wed, 5 Aug 2026 21:46:03 +0900
| Newsgroups | dev.linux.lists.dm-devel,org.kernel.vger.linux-block,org.kernel.vger.linux-fsdevel,org.kernel.vger.stable |
|---|---|
| Message-ID | <anMscoGkR5BYjSGy@shinmob> |
Cc+: 0wnerD1ed On Jul 20, 2026 / 13:10, 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. Recently, the new test case block/045 was added to blkests through a GitHub PR [1]. The test case passes with the Linux master branch tags v7.2-rcX. Today, I found that it fails with block/for-next branch tip [2]. I bisected and found that this patch triggers the failure. 0wnerDied, Keith, may I ask your help to resolve the failure? I'm guessing the test case needs to care device's dma alignment, but not so sure. [1] https://github.com/linux-blktests/blktests/pull/251 [2] failure log of block/045 block/045 (test direct I/O full-trim bvec alignment) [failed] runtime 0.550s ... 0.630s --- tests/block/045.out 2026-08-03 19:26:40.407053612 +0900 +++ /home/shin/Blktests/blktests/results/nodev/block/045.out.bad 2026-08-05 20:48:33.366932845 +0900 @@ -1,2 +1,4 @@ Running block/045 +bio-full-trim: pread returned -1 (errno 22) +bio-full-trim helper failed Test complete block/045 (zoned) (test direct I/O full-trim bvec alignment) [failed] runtime 0.578s ... 0.636s --- tests/block/045.out 2026-08-03 19:26:40.407053612 +0900 +++ /home/shin/Blktests/blktests/results/nodev_zoned/block/045.out.bad 2026-08-05 20:48:34.550929436 +0900 @@ -1,2 +1,4 @@ Running block/045 +bio-full-trim: pread returned -1 (errno 22) +bio-full-trim helper failed Test complete