CVE-2026-53185: zram: fix use-after-free in zram_bvec_write_partial()
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
zram: fix use-after-free in zram_bvec_write_partial()
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 4e3c87b9421d ("zram: fix synchronous reads") for the same reason; the write_partial counterpart was missed.
The Linux kernel CVE team has assigned CVE-2026-53185 to this issue.
Affected and fixed versions
===========================
Issue introduced in 4.14 with commit 8e654f8fbff52ac483fb69957222853d7e2fc588 and fixed in 6.6.143 with commit 0c2821665ff71be3f4b07ecece384669f2877f6a Issue introduced in 4.14 with commit 8e654f8fbff52ac483fb69957222853d7e2fc588 and fixed in 6.12.94 with commit 77a602b505ce4802915853cfc435a4722fab3e64 Issue introduced in 4.14 with commit 8e654f8fbff52ac483fb69957222853d7e2fc588 and fixed in 6.18.36 with commit c96786d6ff1acc1d54d9241e97767554c1dfdd5b Issue introduced in 4.14 with commit 8e654f8fbff52ac483fb69957222853d7e2fc588 and fixed in 7.0.13 with commit 198b5a14cca27263b9c14b20114c8092de15dfcb Issue introduced in 4.14 with commit 8e654f8fbff52ac483fb69957222853d7e2fc588 and fixed in 7.1 with commit 732fd9f0b9c1cdc6dfd77162ded60df005182cc0
Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.
Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at
https://cve.org/CVERecord/?id=CVE-2026-53185
will be updated if fixes are backported, please check that for the most up to date information about this issue.
Affected files
==============
The file(s) affected by this issue are:
drivers/block/zram/zram_drv.c
Mitigation
==========
The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:
https://git.kernel.org/stable/c/0c2821665ff71be3f4b07ecece384669f2877f6a https://git.kernel.org/stable/c/77a602b505ce4802915853cfc435a4722fab3e64 https://git.kernel.org/stable/c/c96786d6ff1acc1d54d9241e97767554c1dfdd5b https://git.kernel.org/stable/c/198b5a14cca27263b9c14b20114c8092de15dfcb https://git.kernel.org/stable/c/732fd9f0b9c1cdc6dfd77162ded60df005182cc0