Linux kernel -stable discussions
 help / color / mirror / Atom feed
From: Sergey Senozhatsky <senozhatsky@chromium.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: mm-commits@vger.kernel.org, stable@vger.kernel.org,
	 senozhatsky@chromium.org, minchan@kernel.org,
	hannes@cmpxchg.org, gourry@gourry.net,  dan.j.williams@intel.com,
	chengming.zhou@linux.dev, contact.kartikn@gmail.com
Subject: Re: + zsmalloc-zero-initialize-zspage-memory-to-prevent-kmsan-uninit-reads.patch added to mm-hotfixes-unstable branch
Date: Wed, 13 May 2026 15:16:22 +0900	[thread overview]
Message-ID: <agQWo3GZfuGMkgn5@google.com> (raw)
In-Reply-To: <20260512214850.3AE80C2BCB0@smtp.kernel.org>

On (26/05/12 14:48), Andrew Morton wrote:
> The patch titled
>      Subject: zsmalloc: zero-initialize zspage memory to prevent KMSAN uninit reads
> has been added to the -mm mm-hotfixes-unstable branch.  Its filename is
>      zsmalloc-zero-initialize-zspage-memory-to-prevent-kmsan-uninit-reads.patch
> 
> This patch will shortly appear at
>      https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/zsmalloc-zero-initialize-zspage-memory-to-prevent-kmsan-uninit-reads.patch
> 
> This patch will later appear in the mm-hotfixes-unstable branch at
>     git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
> 
> Before you just go and hit "reply", please:
>    a) Consider who else should be cc'ed
>    b) Prefer to cc a suitable mailing list as well
>    c) Ideally: find the original patch on the mailing list and do a
>       reply-to-all to that, adding suitable additional cc's
> 
> *** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
> 
> The -mm tree is included into linux-next via various
> branches at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
> and is updated there most days
> 
> ------------------------------------------------------
> 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.

This is very unlikely to fix anything, we should not have out-of-bounds
reads in the first place.

      reply	other threads:[~2026-05-13  6:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-12 21:48 + zsmalloc-zero-initialize-zspage-memory-to-prevent-kmsan-uninit-reads.patch added to mm-hotfixes-unstable branch Andrew Morton
2026-05-13  6:16 ` Sergey Senozhatsky [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=agQWo3GZfuGMkgn5@google.com \
    --to=senozhatsky@chromium.org \
    --cc=akpm@linux-foundation.org \
    --cc=chengming.zhou@linux.dev \
    --cc=contact.kartikn@gmail.com \
    --cc=dan.j.williams@intel.com \
    --cc=gourry@gourry.net \
    --cc=hannes@cmpxchg.org \
    --cc=minchan@kernel.org \
    --cc=mm-commits@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox