Skip to content

zram: fix UAF in zram_bvec_write_partial() and drop dead bio plumbing#891

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

zram: fix UAF in zram_bvec_write_partial() and drop dead bio plumbing#891
blktests-ci[bot] wants to merge 2 commits into
linus-master_basefrom
series/1101371=>linus-master

Conversation

@blktests-ci
Copy link
Copy Markdown

@blktests-ci blktests-ci Bot commented May 27, 2026

Pull request for series with
subject: zram: fix UAF in zram_bvec_write_partial() and drop dead bio plumbing
version: 2
url: https://patchwork.kernel.org/project/linux-block/list/?series=1101371

@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci Bot commented May 27, 2026

Upstream branch: e8c2f9f
series: https://patchwork.kernel.org/project/linux-block/list/?series=1101371
version: 2

Cunlong Li added 2 commits May 27, 2026 07:29
zram_read_page() picks the sync or async backing device read path
based on whether the parent bio is NULL.  zram_bvec_write_partial()
passes its parent bio down, so for ZRAM_WB slots the read is
dispatched asynchronously and zram_read_page() returns 0 while the
bio is still in flight.  The caller then runs memcpy_from_bvec(),
zram_write_page() and __free_page() on the buffer, leaving the
async read to write into a freed page.

zram_bvec_read_partial() was switched to NULL in commit 4e3c87b
("zram: fix synchronous reads") for the same reason; the
write_partial counterpart was missed.

Fixes: 4e3c87b ("zram: fix synchronous reads")
Cc: Christoph Hellwig <hch@lst.de>
Cc: stable@vger.kernel.org
Signed-off-by: Cunlong Li <shenxiaogll@gmail.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
After the previous fix, zram_bvec_write_partial() always passes NULL
to zram_read_page() and no longer needs the parent bio.  Mirror the
read side (zram_bvec_read_partial() has not taken a bio since commit
4e3c87b ("zram: fix synchronous reads")) and drop the parameter
from zram_bvec_write_partial() and zram_bvec_write().

No functional change.

Signed-off-by: Cunlong Li <shenxiaogll@gmail.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci Bot commented May 27, 2026

Upstream branch: e8c2f9f
series: https://patchwork.kernel.org/project/linux-block/list/?series=1101371
version: 2

@blktests-ci blktests-ci Bot force-pushed the series/1101371=>linus-master branch from 9c5e381 to 269cc0f Compare May 27, 2026 07:30
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