From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 8BF11247280 for ; Thu, 16 Jul 2026 02:31:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784169113; cv=none; b=mCXhnpbixDYbWvu3PmfK85SNJa4okDZqJAC04bSdZJrWrznqE1wFd8YdnT021USwCcI/dChvCM4zteAguNodHVRKF8H79g+B8fye/RQ8jCm9bxso3icV+iqMF45G8+hSSPkDtjow3E/79Dr/6BGkbCR7Hk6k4eb7e3jhnNGS29s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784169113; c=relaxed/simple; bh=ynGIyMuoCcAD8NaeJqodKE7wCOdyZZLepombpmz0j20=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=eAf3djXc6nicSb0XpizEtTyNoujskdXLl2G07FmQ6zivQMiPMkq5z1XNpqiU0vBO7iXRLlKHVPb6vvRNumsLxSuS/UT/41KDhmKCKBFp4njcl7HnyadOCqvKQTr1ck50/AKj1UhNUEpm7T6//3tx5kc7ftRnAkb9qVsXiDLWkTU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=arYbAtWK; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="arYbAtWK" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DCADC1F000E9; Thu, 16 Jul 2026 02:31:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1784169112; bh=ynGIyMuoCcAD8NaeJqodKE7wCOdyZZLepombpmz0j20=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=arYbAtWK4LRZHodP80tz03WZeyNNdKPJq+lxECSV5GryUBNFR5Gk4F6+APA2CQnOb 08c5nJ7fZJCbIMppyZmV/AqhU5CfENRjMb9CqkND87C9YH+JPlEafl1lhYR23Le9dW d7zZYG6LcET4EoWG/1qg2n9J9np9e++xKP6F6sxNRxGqDwRulzu0s16W676NdNWQ5N qAIwZNqBZnfQ1X+GoYYhmmmEt/I44c+WNrchLy/Mm7RlGEXSNHLSkJY78+XhmOflSy EbUXzEig/dVOJvqrLh+J3egH77K1PgPo2mzv8evsi+pBbV5b/rbLkhzFWLL8bF6V03 q9GVYEU79wMAQ== Message-ID: <093c6dbe-6ca3-47cd-bf8d-3cc85c13f7ac@kernel.org> Date: Thu, 16 Jul 2026 11:31:45 +0900 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH slab/for-next-fixes v3 1/4] mm/slab: fix a memory leak due to bootstrapping sheaves twice To: Suren Baghdasaryan Cc: Vlastimil Babka , Andrew Morton , Hao Li , Christoph Lameter , David Rientjes , Roman Gushchin , "Liam R. Howlett" , Hao Ge , Kees Cook , Pedro Falcato , Shakeel Butt , Danielle Constantino , linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20260713-kmalloc-no-objext-v3-0-47c7bd138de7@kernel.org> <20260713-kmalloc-no-objext-v3-1-47c7bd138de7@kernel.org> Content-Language: en-US From: Harry Yoo In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------fEYtHpWT6oe3c0X3dvhfUDl0" This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------fEYtHpWT6oe3c0X3dvhfUDl0 Content-Type: multipart/mixed; boundary="------------vbeyTvd6sxOFnT8cjLtWNjuj"; protected-headers="v1" From: Harry Yoo To: Suren Baghdasaryan Cc: Vlastimil Babka , Andrew Morton , Hao Li , Christoph Lameter , David Rientjes , Roman Gushchin , "Liam R. Howlett" , Hao Ge , Kees Cook , Pedro Falcato , Shakeel Butt , Danielle Constantino , linux-mm@kvack.org, linux-kernel@vger.kernel.org Message-ID: <093c6dbe-6ca3-47cd-bf8d-3cc85c13f7ac@kernel.org> Subject: Re: [PATCH slab/for-next-fixes v3 1/4] mm/slab: fix a memory leak due to bootstrapping sheaves twice References: <20260713-kmalloc-no-objext-v3-0-47c7bd138de7@kernel.org> <20260713-kmalloc-no-objext-v3-1-47c7bd138de7@kernel.org> In-Reply-To: --------------vbeyTvd6sxOFnT8cjLtWNjuj Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 7/14/26 12:30 AM, Suren Baghdasaryan wrote: > On Mon, Jul 13, 2026 at 7:29=E2=80=AFAM Harry Yoo (Oracle) wrote: >> >> When kmalloc caches are aliased, multiple cache pointers reference >> the same kmem_cache. As a result, iterating over kmalloc indices and >> bootstrapping sheaves can bootstrap the same cache more than once and >> leak memory. >> >> Currently, this could happen when the architecture specifies >> minimum alignment for slab caches that is larger than >> ARCH_KMALLOC_MINALIGN. >> >> Bootstrap sheaves only when the cache does not have them already. >> Add a warning when bootstrap_cache_sheaves() is called for a cache >> that already has sheaves enabled. >> >> Cc: stable@vger.kernel.org >> Fixes: 913ffd3a1bf5 ("slab: handle kmalloc sheaves bootstrap") >> Signed-off-by: Harry Yoo (Oracle) >=20 > nit: Don't know if we really need a warning... Hehe, at least the warning allowed me to confirm that this is not an oversight and the patch fixed it :) > I would just do an > early return from bootstrap_cache_sheaves() if cache_has_sheaves() is > true. But that's not critical. But yeah, no strong opinion on this. > Reviewed-by: Suren Baghdasaryan Thanks! --=20 Cheers, Harry / Hyeonggon --------------vbeyTvd6sxOFnT8cjLtWNjuj-- --------------fEYtHpWT6oe3c0X3dvhfUDl0 Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature.asc" -----BEGIN PGP SIGNATURE----- iHUEARYKAB0WIQQQ1ub6gR5ogjaKRmOGXBN6rc5S1gUCalhCkQAKCRCGXBN6rc5S 1nsaAQCpaAuH8Gtt1L7sSRp6NLtXdS3rymXJGVx8TEl7PzJAMQD/f0VpUHt3Q/Xa GgIaG4fD6fiQReheoPjiIEKi+SYxpQ4= =y4X0 -----END PGP SIGNATURE----- --------------fEYtHpWT6oe3c0X3dvhfUDl0--