From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f172.google.com (mail-pl1-f172.google.com [209.85.214.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 954AE33E7 for ; Wed, 25 Mar 2026 01:46:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774403193; cv=none; b=cSQ/IRXcHRB5Fqin04iC6oNCFxJltLlvyzmwSEkZNjCMnSShpURhDDCAeWh+nKoMYyflZrZIYGHS6GBoK960NcQkqPeOG/DeBLmCK7cjAaLV3aU5pGSx8dUlwmWxETuP8O6aoD3bN4ANaCyk9zMl1QSFX4tnx/uAM5m6Hp57OhE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774403193; c=relaxed/simple; bh=J05DKlmK+44ZtncLnTpEsjlOqflBQqjoy8CruuSFAdw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=mI3AnwvkkXItvqTPj/AN+f/PY5KIVIyc+bQu7/x369vrXHe3zriqCAPx2rSTDfK8bwSc+8snsUtxQV1rNr/3OJSFAXtX5huHqkhaKaGnMt+4HRTW9zhWdjOIDFt3zXZEX7cyDmseHSzeWCnnBtaG3+JWAkVOC2l8tn5oZAuESyQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=JPqrEXjZ; arc=none smtp.client-ip=209.85.214.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="JPqrEXjZ" Received: by mail-pl1-f172.google.com with SMTP id d9443c01a7336-2b0603ee486so13526445ad.0 for ; Tue, 24 Mar 2026 18:46:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1774403191; x=1775007991; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=XAqwg4AZtsESsH97IIgmTxvMLL2sE46/gIAdnIuPc+o=; b=JPqrEXjZp25gpFGUSP9UPyNEimPuO5kDezLntBJaie7NmpgP5aOJfx7msCr7jMxfJC 9yCDdvalRYJTzxgXk0xllsG5glyTCC2tTLJaT6e1I6VCvdgPLp/0WP+o3PIvq/00uCCJ r6VZpYboTCmYS8S7U8dCMTqew32nNi072OEk4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774403191; x=1775007991; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XAqwg4AZtsESsH97IIgmTxvMLL2sE46/gIAdnIuPc+o=; b=f0BjeXYGLii+3T0s0cf5XbBoOiAkDh/d1+Nr2VzIIpi8exdEd9nX7Di1sOuuYRGvqD GJrofnFETERXW0wEy/qbPpjbURs6qNazVKAnyomtk5crBGSgz+70y42iUeZav2h76Do9 oYBjtulDzMlAy19ff5Mwoide6gVgSYrNNQ3qR/QK3r8q/l3jp5uqzRS5+z4Wzr31Mrzh suMWFBPlIYYGCewcBHz30U2q6u9rwtNfJ5s0IzSZDmPFarTb2HY73kuSb3SR1iWWM7Im 1yuLvnqU4yzHV0kzgxdRu9aSB3Zf1UZ9/w0R3dVdF4V5JDkcNyoJKxst/hhWhvq+OAnJ J2LA== X-Forwarded-Encrypted: i=1; AJvYcCWCbGtbSbRYirOG66dYnrU1UpjObGnXiCxwgQUzaNXArDUF5QIsEnYaBoSvB0eyi6SDXc3oKd4=@vger.kernel.org X-Gm-Message-State: AOJu0YxFmArW1QSNro3kiJXobKyDJPl1iaxvbCKS4yK2gexcSfYxGphr b4b83CIDs4EwC0CBThCJYtHfglYvzj0srSTtfeFQR60AZZ4sEH2IHi8ecMbmAwDuUw== X-Gm-Gg: ATEYQzw9YXbaJvxtoH7wBo9YJChCJ/VWGucx2PsBCKqoLXQyiq17fg28CQ+0UZhcjmP aUnEjNDHga2obdeWU2pBDyEc7KcUU5lXb0URDbxbxx1g77aJvId4MTUAUEKO0ceytPuZrWQ42lt F7eRvROn6XAyDFJej8gsZiygSn5gRkWgih+Jxkyo6Rq+GE6Pu8pBaikbS4VtZ8kazqc6MDYu71L 7EjFmhxtmucLjZAYq30RPDiZKPoXma4O6jlansmBwRhlxBpB1PCM3l1r+kKWBoAtBlfyoGX5x2A GQMDeYaxSlaCP2LSn8dL2oUmWd4sOwIqaPMkaF7Ayr9c8HB2tl+sVS4UfkDNGWG3gxzFdNtt6/N 1bgweOL2EV3PW3EYOhEhUG5CjeR6xhfcWM1NjepWm1djzHZM/RU+ivT33htTEZz5XSXXn45CDmJ 4B6M/8YDID8IMjSt0JgdKchx9LeshCLnjoDMltMSFWxdGNmpXsoSAzwLKa8Zk+iICNWfeR26+g+ A== X-Received: by 2002:a17:902:ebc2:b0:2aa:d5e5:b136 with SMTP id d9443c01a7336-2b0b0af3befmr20192675ad.38.1774403190926; Tue, 24 Mar 2026 18:46:30 -0700 (PDT) Received: from google.com ([2a00:79e0:2031:6:b91b:3806:4771:9ab8]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2b083527f84sm153641805ad.18.2026.03.24.18.46.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Mar 2026 18:46:29 -0700 (PDT) Date: Wed, 25 Mar 2026 10:46:26 +0900 From: Sergey Senozhatsky To: Andrew Morton Cc: mm-commits@vger.kernel.org, stable@vger.kernel.org, senozhatsky@chromium.org, minchan@kernel.org, mark-pk.tsai@mediatek.com, syoshida@redhat.com Subject: Re: + mm-zsmalloc-copy-kmsan-metadata-in-zs_page_migrate.patch added to mm-new branch Message-ID: References: <20260321175018.5B0E7C19421@smtp.kernel.org> Precedence: bulk X-Mailing-List: stable@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: <20260321175018.5B0E7C19421@smtp.kernel.org> On (26/03/21 10:50), Andrew Morton wrote: > This patch will shortly appear at > https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-zsmalloc-copy-kmsan-metadata-in-zs_page_migrate.patch > [..] > ------------------------------------------------------ > From: Shigeru Yoshida > Subject: mm/zsmalloc: copy KMSAN metadata in zs_page_migrate() > Date: Sat, 21 Mar 2026 22:29:11 +0900 > > zs_page_migrate() uses copy_page() to copy the contents of a zspage page > during migration. However, copy_page() is not instrumented by KMSAN, so > the shadow and origin metadata of the destination page are not updated. > > As a result, subsequent accesses to the migrated page are reported as > use-after-free by KMSAN, despite the data being correctly copied. > > Add a kmsan_copy_page_meta() call after copy_page() to propagate the KMSAN > metadata to the new page, matching what copy_highpage() does internally. > > Link: https://lkml.kernel.org/r/20260321132912.93434-1-syoshida@redhat.com > Fixes: afb2d666d025 ("zsmalloc: use copy_page for full page copy") > Signed-off-by: Shigeru Yoshida > Cc: Mark-PK Tsai > Cc: Minchan Kim > Cc: Sergey Senozhatsky > Cc: > Signed-off-by: Andrew Morton Reviewed-by: Sergey Senozhatsky