direct-io: validate user space vectors during extraction#977
Open
blktests-ci[bot] wants to merge 6 commits into
Open
direct-io: validate user space vectors during extraction#977blktests-ci[bot] wants to merge 6 commits into
blktests-ci[bot] wants to merge 6 commits into
Conversation
Author
|
Upstream branch: 66affa3 |
Author
|
Upstream branch: 66affa3 |
a551f2e to
e81ad88
Compare
Author
|
Upstream branch: 66affa3 |
e81ad88 to
867f2ba
Compare
e6d9eb8 to
7d8604f
Compare
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>
Author
|
Upstream branch: bade58e |
867f2ba to
f6aac90
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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