From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from abb.hmeau.com (abb.hmeau.com [180.181.231.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 980503A6EE5 for ; Wed, 13 May 2026 05:44:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=180.181.231.80 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778651064; cv=none; b=ElzeUANweFLUngmYUaNr9FlzAVYv24c1UlDunQ3uFIeo5eZYei/IbcRgG3IPltQozeefJmLnWJfzOE83PI4lfHWA8ShN8kEn2hUGxTtxWHBwYMHYZB1uRUowtc418oMKSNtn8fLBmCd+qK//fDLtdzRWhi3OoqZxxxZ9W9OEG00= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778651064; c=relaxed/simple; bh=0X7xYaRUXRUqZHg/0eZjRZcZKE3Q1ZERKejv8X9k/tc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=NusDw9jBF8v5Vn72sDxrxi8oh8RiDUVPL7aGtAm6tHem47FzFGe22BGc/T8hQ3xmKYoKkzO00RPs+J2aKHTjoR17HHpQQuj1vSRLwanhub8xujdrvrtV+Kcu53vTIJSNuBskKZd16HxvPQgXmTbEwlEbTH88MsKldmIIN7GOBAQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gondor.apana.org.au; spf=pass smtp.mailfrom=gondor.apana.org.au; dkim=pass (2048-bit key) header.d=gondor.apana.org.au header.i=@gondor.apana.org.au header.b=M9LcoS8f; arc=none smtp.client-ip=180.181.231.80 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gondor.apana.org.au Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gondor.apana.org.au Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gondor.apana.org.au header.i=@gondor.apana.org.au header.b="M9LcoS8f" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gondor.apana.org.au; s=h01; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:cc:to:subject:message-id:date: from:content-type:reply-to; bh=VH1edBJdBGzw5mNVeuwXmCELmWasSoSUvztaIxLYKcc=; b=M9LcoS8fZVm4OVfdXJJyg4R9GvShiV7gUmavpAYWDUU65Sisf/xAS6ZVn3aM1XnaHEmB8Xn7pnC QSjeZ84VCxLkhRNd/aWvRgfDYEPG26ibuJ2nZB5GBCEunEI/+9onWOakJvS1l7TZjZXGmP1alhqMz mkMGEiBSwkTkV4i36lWWBOIJk4yGXV0n6Ryc2xMj96yWKSVQn2jEJXQftxdG06tP9VDAz+9AUfJD4 dzYGMtwKi45PLEypLLKCrmumbfJJ3+hxUzKjHnY8vg/Hwae5SrhXerqLm53qSjFyh/RTbBVgHGwvW 7+8sfqQXJAblmYNYcuwCSA0bcD/9ozlQWhrA==; Received: from loth.rohan.me.apana.org.au ([192.168.167.2]) by formenos.hmeau.com with smtp (Exim 4.96 #2 (Debian)) id 1wN2Ny-00DhFl-1i; Wed, 13 May 2026 13:43:59 +0800 Received: by loth.rohan.me.apana.org.au (sSMTP sendmail emulation); Wed, 13 May 2026 13:43:58 +0800 Date: Wed, 13 May 2026 13:43:58 +0800 From: Herbert Xu To: Sergey Senozhatsky Cc: Andrew Morton , Yosry Ahmed , Kartik Nair , minchan@kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, syzbot+8f77ff6144a73f0cf71b@syzkaller.appspotmail.com, Nhat Pham Subject: Re: [PATCH] zsmalloc: zero-initialize zspage memory to prevent KMSAN uninit reads Message-ID: References: <20260511213658.25273-1-contact.kartikn@gmail.com> <20260512144733.9132c83e392a109743e92f71@linux-foundation.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Wed, May 13, 2026 at 11:47:41AM +0900, Sergey Senozhatsky wrote: > Adding Yosry and Herbert, > > On (26/05/12 14:47), Andrew Morton wrote: > > > 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). > > I don't get this. How can sw842_decompress() read more bytes than > it's told to decompress. We first compress and store the object, > before we load and decompress, reading past the known compressed > object size (which we pass to decompress function) should not happen. > Yosry, Herbert, any ideas? It sounds like a bug in 842. I'll look into it. Thanks for pointer. -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt