From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-189.mta0.migadu.com (out-189.mta0.migadu.com [91.218.175.189]) (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 92C55E54B for ; Fri, 17 Jul 2026 01:16:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.189 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784251016; cv=none; b=cJnKJqJI08YblcKDumrTaIjW7UMFH9L0JKBVgnejUlWIGRYCz66WGbSCexKu+6PL180ndECviv010o9NKPImQ5vH5Rcj77eFq0c5EoOzLUOkeAzw12U2Vr6eggxw8MVnxSDfelxSmd3X7MEwZius97uaUzPJAXZ+hzsGEMY5n1E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784251016; c=relaxed/simple; bh=Iv8AaKCGHur7oMdzSudHrix0jfV790vQpgyA6jBXp8I=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=brHeyww9m3RWnA9THB+Mdzs0FcKfZ5JVUh4JQ07/G58iwNbfdIHHglDsHyPjTWQ7f8HVDOZZYHNTKgKl7q5mPR87SBjj/GBhMyofF6PQr0c1OihwtgzIj+6+nTTFPWOFfgIiGij7w+5k1R6FoqWddyzmlXrUleQhQNQx1peH8OI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=R/x3Ix+H; arc=none smtp.client-ip=91.218.175.189 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="R/x3Ix+H" Message-ID: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1784251012; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=SIDjRquBy4YJKkzONeBnIvIFlWxts+jE0CMwzUMcbKc=; b=R/x3Ix+HPE5GedYZWQsjBQy4X9l9tXKZ6io/MGnznvuPOzxBS23Qq8XuWUb0D/ZBYkSpwL u4DJojxrnGHpnwWCBZj66YWuSXG5e79ObwmYJZ3A+btzc11gQ21bKAqZ8wLPRaW+Csh4GI FXrGc/t7wOT0O2BTNZkyFwcApcr+CtU= Date: Fri, 17 Jul 2026 09:16:19 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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 , Kees Cook , Pedro Falcato , Danielle Constantino , linux-mm@kvack.org, linux-kernel@vger.kernel.org, "Harry Yoo (Oracle)" References: <20260713-kmalloc-no-objext-v3-0-47c7bd138de7@kernel.org> Content-Language: en-US X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Hao Ge In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT On 2026/7/17 03:37, 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_exts >> 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 other >> 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 lack >> 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-7f6091e9aa14@kernel.org >> >> [2] https://git.kernel.org/pub/scm/linux/kernel/git/harry/linux.git/log/?h=kmalloc-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) > I tested next-20260716 which has this series against next-20260707 which does > not have the fix. The reproducer were able to trigger the leak/recursion on > next-20260707 but not on next-20260716. So, you can add: Hi Shakeel It seems you have a consistent stable reproduction method or test script. Would you mind sharing it if possible?  I'm sorry if this was provided earlier and I overlooked it. I'd like to thoroughly investigate and learn about this problem. Thank you very much. Thanks Best Regards Hao > > Tested-by: Shakeel Butt >