Skip to content

direct-io: validate user space vectors during extraction#977

Open
blktests-ci[bot] wants to merge 6 commits into
linus-master_basefrom
series/1113158=>linus-master
Open

direct-io: validate user space vectors during extraction#977
blktests-ci[bot] wants to merge 6 commits into
linus-master_basefrom
series/1113158=>linus-master

Conversation

@blktests-ci

@blktests-ci blktests-ci Bot commented Jun 18, 2026

Copy link
Copy Markdown

Pull request for series with
subject: direct-io: validate user space vectors during extraction
version: 1
url: https://patchwork.kernel.org/project/linux-block/list/?series=1113158

@blktests-ci

blktests-ci Bot commented Jun 18, 2026

Copy link
Copy Markdown
Author

Upstream branch: 66affa3
series: https://patchwork.kernel.org/project/linux-block/list/?series=1113158
version: 1

@blktests-ci

blktests-ci Bot commented Jun 22, 2026

Copy link
Copy Markdown
Author

Upstream branch: 66affa3
series: https://patchwork.kernel.org/project/linux-block/list/?series=1114877
version: 1

@blktests-ci blktests-ci Bot force-pushed the series/1113158=>linus-master branch from a551f2e to e81ad88 Compare June 22, 2026 18:24
@blktests-ci

blktests-ci Bot commented Jun 23, 2026

Copy link
Copy Markdown
Author

Upstream branch: 66affa3
series: https://patchwork.kernel.org/project/linux-block/list/?series=1114877
version: 1

@blktests-ci blktests-ci Bot force-pushed the series/1113158=>linus-master branch from e81ad88 to 867f2ba Compare June 23, 2026 15:40
@blktests-ci blktests-ci Bot force-pushed the linus-master_base branch from e6d9eb8 to 7d8604f Compare June 24, 2026 01:11
No functional change; purely introducing a convenience function.

Signed-off-by: Keith Busch <kbusch@kernel.org>
Rather than assume EIO, set the actual reported status for user space
informational purposes.

Signed-off-by: Keith Busch <kbusch@kernel.org>
A failed integrity mapping holds a dio reference, so we need to go
through the full bio ending in case there were previously submitted
bio's in the sequence.

Fixes: 2729a60 ("block: don't silently ignore metadata for sync read/write")
Signed-off-by: Keith Busch <kbusch@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Direct I/O user pages are forwarded to the backing file unchanged, so
the backing's DMA alignment requirement applies to them. Track the
backing's dio_mem_align and advertise it as the loop device's
dma_alignment so we advertise proper limits and misaligned I/O is
rejected here instead of being dispatched to the backend.

Signed-off-by: Keith Busch <kbusch@kernel.org>
Direct I/O request's use pages handed to the backing files unchanged, so
the backing's DMA alignment requirement applies. Track dio_mem_align and
advertise it as the device's dma_alignment so we communicate proper
limits and misaligned I/O is rejected here instead of reaching the
backend.

Signed-off-by: Keith Busch <kbusch@kernel.org>
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: stable@vger.kernel.org
Fixes: 5ff3f74 ("block: simplify direct io validity check")
Fixes: 7eac331 ("iomap: simplify direct io validity check")
Signed-off-by: Keith Busch <kbusch@kernel.org>
@blktests-ci

blktests-ci Bot commented Jun 24, 2026

Copy link
Copy Markdown
Author

Upstream branch: bade58e
series: https://patchwork.kernel.org/project/linux-block/list/?series=1114877
version: 1

@blktests-ci blktests-ci Bot force-pushed the series/1113158=>linus-master branch from 867f2ba to f6aac90 Compare June 24, 2026 01:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant