* [obsolete] zsmalloc-zero-initialize-zspage-memory-to-prevent-kmsan-uninit-reads.patch removed from -mm tree
@ 2026-05-13 16:15 Andrew Morton
0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2026-05-13 16:15 UTC (permalink / raw)
To: mm-commits, stable, senozhatsky, minchan, hannes, gourry,
dan.j.williams, chengming.zhou, contact.kartikn, akpm
The quilt patch titled
Subject: zsmalloc: zero-initialize zspage memory to prevent KMSAN uninit reads
has been removed from the -mm tree. Its filename was
zsmalloc-zero-initialize-zspage-memory-to-prevent-kmsan-uninit-reads.patch
This patch was dropped because it is obsolete
------------------------------------------------------
From: Kartik Nair <contact.kartikn@gmail.com>
Subject: zsmalloc: zero-initialize zspage memory to prevent KMSAN uninit reads
Date: Tue, 12 May 2026 03:06:58 +0530
Pages allocated via alloc_zpdesc() use alloc_pages_node() without
__GFP_ZERO, leaving physical memory uninitialized. When a compressed
object spans two physical pages in a zspage, zs_obj_read_sg_begin() sets
up a scatterlist pointing directly at the raw second page. If the second
page was freshly allocated and never written beyond the object boundary,
KMSAN detects reads of uninitialized memory downstream in the decompressor
(e.g. sw842_decompress reading the CRC trailer).
Fix this by passing __GFP_ZERO to alloc_zpdesc() in alloc_zspage() so
all pages backing a zspage are zero-initialized at allocation time.
Link: https://lore.kernel.org/20260511213658.25273-1-contact.kartikn@gmail.com
Fixes: dc2e4982cb018 ("zsmalloc: introduce SG-list based object read API")
Reported-by: syzbot+8f77ff6144a73f0cf71b@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=8f77ff6144a73f0cf71b
Signed-off-by: Kartik Nair <contact.kartikn@gmail.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Sergey Senozhatsky <senozhatsky@chromium.org>
Cc: Chengming Zhou <chengming.zhou@linux.dev>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Gregory Price <gourry@gourry.net>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
mm/zsmalloc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/mm/zsmalloc.c~zsmalloc-zero-initialize-zspage-memory-to-prevent-kmsan-uninit-reads
+++ a/mm/zsmalloc.c
@@ -951,7 +951,7 @@ static struct zspage *alloc_zspage(struc
for (i = 0; i < class->pages_per_zspage; i++) {
struct zpdesc *zpdesc;
- zpdesc = alloc_zpdesc(gfp, nid);
+ zpdesc = alloc_zpdesc(gfp | __GFP_ZERO, nid);
if (!zpdesc) {
while (--i >= 0) {
zpdesc_dec_zone_page_state(zpdescs[i]);
_
Patches currently in -mm which might be from contact.kartikn@gmail.com are
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-05-13 16:15 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-13 16:15 [obsolete] zsmalloc-zero-initialize-zspage-memory-to-prevent-kmsan-uninit-reads.patch removed from -mm tree Andrew Morton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox