Skip to content

block: avoid integer overflows in max_integrity_io_size - #1268

Open
blktests-ci-kpd[bot] wants to merge 3 commits into
linus-master_basefrom
series/1159496=>linus-master
Open

blktests-ci-kpd[bot] wants to merge 3 commits into
linus-master_basefrom
series/1159496=>linus-master

Conversation

@blktests-ci-kpd

Copy link
Copy Markdown

Pull request for series with
subject: block: avoid integer overflows in max_integrity_io_size
version: 1
url: https://patchwork.kernel.org/series/1159496/

@blktests-ci-kpd

Copy link
Copy Markdown
Author

Upstream branch: 28924df
series: https://patchwork.kernel.org/series/1159496/
version: 1

@blktests-ci-kpd

Copy link
Copy Markdown
Author

Upstream branch: 893e117
series: https://patchwork.kernel.org/series/1159496/
version: 1

@blktests-ci-kpd
blktests-ci-kpd Bot force-pushed the series/1159496=>linus-master branch from 2acf323 to f5219e9 Compare September 9, 2026 07:57
@blktests-ci-kpd

Copy link
Copy Markdown
Author

Upstream branch: 50d05c7
series: https://patchwork.kernel.org/series/1159496/
version: 1

@blktests-ci-kpd
blktests-ci-kpd Bot force-pushed the series/1159496=>linus-master branch from f5219e9 to 286efd5 Compare September 10, 2026 15:41
@blktests-ci-kpd

Copy link
Copy Markdown
Author

Upstream branch: 5225b8e
series: https://patchwork.kernel.org/series/1159496/
version: 1

@blktests-ci-kpd

Copy link
Copy Markdown
Author

Upstream branch: 2f0c1cf
series: https://patchwork.kernel.org/series/1159496/
version: 1

@blktests-ci-kpd
blktests-ci-kpd Bot force-pushed the series/1159496=>linus-master branch from 48dda6f to 9b791e2 Compare September 13, 2026 09:47
@blktests-ci-kpd

Copy link
Copy Markdown
Author

Upstream branch: 2f0c1cf
series: https://patchwork.kernel.org/series/1159496/
version: 1

@blktests-ci-kpd
blktests-ci-kpd Bot force-pushed the series/1159496=>linus-master branch from 9b791e2 to 56875c1 Compare September 13, 2026 23:07
Christoph Hellwig added 3 commits September 15, 2026 09:48
Sashiko reports that the calculation in max_integrity_io_size could
overflow a u32 when using 16kiB or larger LBA sizes.  Fix this by
evaluating the maximum size as a 64-bit integer.

Fixes: ec7f31b ("block: make bio auto-integrity deadlock safe")
Signed-off-by: Christoph Hellwig <hch@lst.de>
As Sashiko points out, limiting the I/O size by the size of the available
PI buffer can cause inconsistencies for atomic writes.  This also limit
atomic_write_max_sectors in blk_validate_integrity_limits.

Fixes: ec7f31b ("block: make bio auto-integrity deadlock safe")
Signed-off-by: Christoph Hellwig <hch@lst.de>
Sashiko complained about bio_iov_iter_align_down potentially dropping
bvecs, and thus losing bounce folios.  While losing bio_vecs is real,
bio_iov_iter_bounce_write allocates all segments and thus the entire bio
in multiples of the minsize, thus making the rounding down redundant.

Replace it with a safety rounding down of this_len in case something odd
happens to the greedy folio allocation helper.

Fixes: e7b8b3c ("block: align down bounces bios")
Signed-off-by: Christoph Hellwig <hch@lst.de>
@blktests-ci-kpd

Copy link
Copy Markdown
Author

Upstream branch: 5878583
series: https://patchwork.kernel.org/series/1159496/
version: 1

@blktests-ci-kpd
blktests-ci-kpd Bot force-pushed the series/1159496=>linus-master branch from 56875c1 to 9e7a411 Compare September 15, 2026 09:48
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.

0 participants