From nobody Tue Jun 16 17:02:46 2026 Received: from mxct.zte.com.cn (mxct.zte.com.cn [58.251.27.85]) (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 DA51D3A1682 for ; Thu, 30 Apr 2026 08:35:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=58.251.27.85 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777538148; cv=none; b=SIuqtprQ0/+vjHnhkS2ng9Gb8yUjqC+9jvCZm62C/uTQ4Z7eWtA+++1IUMrV2b0dckTeZOtnnGz586bojLNf0aWmYcVsJ6JYnZuWiGM23dKwZ5K1neZ4G2ao9RpuAa2lTc++boMLn8iXNqgKvJm+d80x4XJHmYN532j3VscRIfc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777538148; c=relaxed/simple; bh=0D8tlPHkzbXCBkrBE0VFYdVJPZpI5vXvLJNZXg2D3+I=; h=Message-ID:Date:Mime-Version:From:To:Cc:Subject:Content-Type; b=csFvPReRXJHZVS7hUaYkqI/w4yNtf8EqYjXFTLGlYg8I9ZIFpDHECmyXskIYiRubhAybJWXSYieddfQnzH7tse4ehCMKmm3Wpa3iX+ljy4tB43YrvbFapYC1HKgogfkyngEQzE4WwgoVzJEb5ed0oExbftYwCmSn0B9p8t4rjLc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zte.com.cn; spf=pass smtp.mailfrom=zte.com.cn; arc=none smtp.client-ip=58.251.27.85 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zte.com.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=zte.com.cn Received: from mxde.zte.com.cn (unknown [10.35.20.121]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mxct.zte.com.cn (FangMail) with ESMTPS id 4g5nYf2LdDzYCb for ; Thu, 30 Apr 2026 16:35:34 +0800 (CST) Received: from mxhk.zte.com.cn (unknown [192.168.250.138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mxde.zte.com.cn (FangMail) with ESMTPS id 4g5nYX20D2zBfd0P for ; Thu, 30 Apr 2026 16:35:28 +0800 (CST) Received: from mse-fl2.zte.com.cn (unknown [10.5.228.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mxhk.zte.com.cn (FangMail) with ESMTPS id 4g5nYM2m0Fz4yjjF; Thu, 30 Apr 2026 16:35:19 +0800 (CST) Received: from xaxapp05.zte.com.cn ([10.99.98.109]) by mse-fl2.zte.com.cn with SMTP id 63U8Z2cF025062; Thu, 30 Apr 2026 16:35:02 +0800 (+08) (envelope-from hu.shengming@zte.com.cn) Received: from mapi (xaxapp05[null]) by mapi (Zmail) with MAPI id mid32; Thu, 30 Apr 2026 16:35:04 +0800 (CST) X-Zmail-TransId: 2afc69f314389d2-eac03 X-Mailer: Zmail v1.0 Message-ID: <20260430163504368ZueB-81tYNin-vhramBnm@zte.com.cn> Date: Thu, 30 Apr 2026 16:35:04 +0800 (CST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 From: To: , , Cc: , , , , , , , Subject: =?UTF-8?B?W1BBVENIXSBtbS9zbHViOiBpbml0aWFsaXplIGFsbG9jYXRlZCBvYmplY3QncyBmcmVlcG9pbnRlciBiZWZvcmUgZGVidWcgY2hlY2s=?= X-MAIL: mse-fl2.zte.com.cn 63U8Z2cF025062 X-TLS: YES X-SPF-DOMAIN: zte.com.cn X-ENVELOPE-SENDER: hu.shengming@zte.com.cn X-SPF: None X-SOURCE-IP: 10.35.20.121 unknown Thu, 30 Apr 2026 16:35:34 +0800 X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 69F31454.001/4g5nYf2LdDzYCb Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Shengming Hu The deferred-freelist path allocates the first object from a fresh slab before building the freelist for the remaining objects. Unlike the old path, the selected object is no longer the head of a pre-built freelist, so its freepointer remains uninitialized. alloc_debug_processing() still checks its freepointer. As a result, boot can report: BUG kmem_cache (Tainted: G B W T ): Freepointer corrupt Restore the old invariant by storing a valid freepointer in the selected object before alloc_debug_processing() runs. The pointer is the head of the leftover freelist, matching what the old pre-built freelist path would have left in the allocated object. Fixes: 895272864130 ("mm/slub: defer freelist construction until after bulk= allocation from a new slab") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-lkp/202604301428.e2b8d3dd-lkp@intel.com Signed-off-by: Shengming Hu --- mm/slub.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/mm/slub.c b/mm/slub.c index f96bac36229c..af942753d495 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -3690,6 +3690,15 @@ static void *alloc_single_from_new_slab(struct kmem_= cache *s, struct slab *slab, needs_add_partial =3D (slab->objects > 1); build_slab_freelist(s, slab, &iter); + /* + * alloc_debug_processing() still checks @object as a free object + * before returning it to the caller. Since @object was emitted + * directly from a fresh slab and skipped by build_slab_freelist(), give + * it the same next pointer it would have had in the old prebuilt + * freelist path. + */ + set_freepointer(s, object, slab->freelist); + if (!alloc_debug_processing(s, slab, object, orig_size)) { /* * It's not really expected that this would fail on a --=20 2.25.1