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 484BC3191CA for ; Fri, 17 Jul 2026 04:10:27 +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=1784261428; cv=none; b=epxAC7puxnSuM8MZE1pvsToTGvzqgLZz0N+8cw4FYoNO1T9zOIkmAxvg3Io4KRC+zgdWfxKNuJtRD+pkPn0gjQvIWeLuHBzT+K39lKzlQ0/pNGJUVUjHlSIBVzN37MaDm4Tqa/R6M+OYxApQYWmBr6YQGio1Ukoj4QupPm1KDdg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784261428; c=relaxed/simple; bh=oBPsEFnIuINeb0d59jQ1pc/qimL3dI1SLr0HV/mChCo=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=s87lmX4xzf1BYmD5+fiGHMucVMGzQ5sOAIqPbKic0WDmUgwVBgANoOJ0V1lAdYXlPlShFNEfnSRQoXl/YkGuJKQpOrQfQknJ8PSs1/C7brHl/KtpUKXatXiWSgJzbMowQaghi/FY3+erhwdB7LvJXlO6UPa1UjnYpSYU105x9QY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=fwm843R8; 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="fwm843R8" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 890781F000E9; Fri, 17 Jul 2026 04:10:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1784261427; bh=oBPsEFnIuINeb0d59jQ1pc/qimL3dI1SLr0HV/mChCo=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=fwm843R8EAtmzMgCpNAb3HbQdaDm9xpvY1IofxPb/8JC0UPXydHIHZetqSltF96qB kleWY1HtyfQmwglzof3U/7KmjqZunJreeG3WcXqDb0yrQiYZ67pQ6095B5NuVXdLWg 57En1oGbgPZplni+H83IHT1WVT7KuQW2Rmu8YOzCOYsrN5w7o0U+x2iAAU9bD3vAjr zLjTEbr2tEtIhQGCcQHX8TPVI6Pp8YNEZ9tTvtqZICyy/3siJv5dfAJ9yjRBYgnH3/ Cu+OtiwKnXcnhBy8kuvQnm2mrNpFbI6XFM2OTbzyBX89rSaUmPp1wDVZl1DiOb8/7W Ia4X2yCmFauZg== Message-ID: <2bbebbfc-fd00-4744-9775-5ba35788b535@kernel.org> Date: Fri, 17 Jul 2026 13:10:21 +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 0/4] mm/slab: fix unbounded recursion in free path with memalloc profiling To: Shakeel Butt Cc: Vlastimil Babka , Andrew Morton , Hao Li , Christoph Lameter , David Rientjes , Roman Gushchin , "Liam R. Howlett" , Suren Baghdasaryan , Hao Ge , Kees Cook , Pedro Falcato , Danielle Constantino , linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20260713-kmalloc-no-objext-v3-0-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="------------97ang00oLjr0Br0NqNg0s6nx" This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------97ang00oLjr0Br0NqNg0s6nx Content-Type: multipart/mixed; boundary="------------g0b90MwtWS09GVit4BpsCzPP"; protected-headers="v1" From: Harry Yoo To: Shakeel Butt Cc: Vlastimil Babka , Andrew Morton , Hao Li , Christoph Lameter , David Rientjes , Roman Gushchin , "Liam R. Howlett" , Suren Baghdasaryan , Hao Ge , Kees Cook , Pedro Falcato , Danielle Constantino , linux-mm@kvack.org, linux-kernel@vger.kernel.org Message-ID: <2bbebbfc-fd00-4744-9775-5ba35788b535@kernel.org> Subject: Re: [PATCH slab/for-next-fixes v3 0/4] mm/slab: fix unbounded recursion in free path with memalloc profiling References: <20260713-kmalloc-no-objext-v3-0-47c7bd138de7@kernel.org> In-Reply-To: --------------g0b90MwtWS09GVit4BpsCzPP Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 7/17/26 4:37 AM, Shakeel Butt wrote: > On Mon, Jul 13, 2026 at 11:28:48PM +0900, Harry Yoo (Oracle) wrote: >> This is a follow-up fix after the recent discussion [1]. >> See patch 4 for the detailed description on the bug. >> >> Based on slab/for-next-fixes (af9ea231c0b45) and is available at >> git.kernel.org [2]. >> >> Instead preventing cycles by bumping up the allocation size of obj_ext= s >> arrays, it introduces a new kmalloc type called KMALLOC_NO_OBJ_EXT and= >> disallow formation of cycles between kmalloc types when allocating >> obj_exts arrays. obj_exts arrays of normal kmalloc caches are served >> from KMALLOC_NO_OBJ_EXT caches (that don't have obj_exts), and all oth= er >> obj_exts arrays are served from normal kmalloc caches. >> >> I tried to reuse SLAB_ALLOC_NO_RECURSE to make kmalloc_slab() select >> KMALLOC_NO_OBJ_EXT, but it was not great because it does not allow >> sheaves for those caches. So I introduced a new slab alloc flag >> SLAB_ALLOC_NO_OBJ_EXT. >> >> To avoid huge confusion, I had to decouple "disallowing sheaves" >> semantics from SLAB_NO_OBJ_EXT and introduced SLAB_NO_SHEAVES. >> >> While this cannot be directly backported to v6.18 and v6.12 due to lac= k >> of SLAB_ALLOC_* flags and kmalloc_flags(), I don't this will be >> particularily challenging to backport it. Instead of a new slab alloc >> flag, we can use __GFP_NO_OBJ_EXT to select KMALLOC_NO_OBJ_EXT as >> kmalloc caches don't have sheaves in v6.18 anyway. >> >> [1] https://lore.kernel.org/linux-mm/9a139365-28e6-4f1e-b35b-7f6091e9a= a14@kernel.org >> >> [2] https://git.kernel.org/pub/scm/linux/kernel/git/harry/linux.git/lo= g/?h=3Dkmalloc-no-objext-v3r1 >> >> To: Vlastimil Babka >> To: Andrew Morton >> To: Hao Li >> To: Christoph Lameter >> To: David Rientjes >> To: Roman Gushchin >> To: Suren Baghdasaryan >> To: Hao Ge >> To: Kees Cook >> To: Pedro Falcato >> To: Shakeel Butt >> To: Danielle Constantino >> To: Liam R. Howlett >> Cc: linux-mm@kvack.org >> Cc: linux-kernel@vger.kernel.org >> Signed-off-by: Harry Yoo (Oracle) >=20 > I tested next-20260716 which has this series against next-20260707 whic= h does > not have the fix. The reproducer were able to trigger the leak/recursio= n on > next-20260707 but not on next-20260716. So, you can add: >=20 > Tested-by: Shakeel Butt Thanks a lot for testing, Shakeel! --=20 Cheers, Harry / Hyeonggon --------------g0b90MwtWS09GVit4BpsCzPP-- --------------97ang00oLjr0Br0NqNg0s6nx Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature.asc" -----BEGIN PGP SIGNATURE----- iHUEARYKAB0WIQQQ1ub6gR5ogjaKRmOGXBN6rc5S1gUCalmrLQAKCRCGXBN6rc5S 1kPKAP9TFo+AR+6tDlg03GS/N+FoSzBpaviqFJvipbg4oFlZxAEAtZLu/EoVUR9r MAnYJRYMCx8C8PuV8b1HVe2BQM9DEgY= =OwA8 -----END PGP SIGNATURE----- --------------97ang00oLjr0Br0NqNg0s6nx--