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 A940B49481D for ; Fri, 25 Sep 2026 10:32:01 +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=1790332322; cv=none; b=D5gfn3YboyfNb42BusB3yRybsEEXJoH0ttsm/6vZqsKqx7bTB9GdKxjX+xumWuWGpaCDHkRXqS57mrjDPZLyBQsYwQymJZCwmEuZ2sNf8at8whQHXjWcq4yWKE8G3cIxkPnYSer42L3GjxvECIt07ULq+B3/p9SSZMrZj+MYhrU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790332322; c=relaxed/simple; bh=tbS/Ru+s0tYNbXXfSprzCOu+PoAyWrQZ8dIOx6zhDG8=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=gsK3vzpZ42si4CxASnu+YTm3FZxcRJCoRMcp7Mb78eld33l7aEXJIYpRtq1xEwGHMWE+779+NfpSxEWjmsjiHXl0q2ttaCQil01UEWqM65OYeu3IjjLG+sW8VX/lcwGxbMtp6Kj7rYXqWypWHImPCS1HZ4jhN+CfNXJJnpCyt7w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=PqcyWmf4; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="PqcyWmf4" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 08B291F000FF; Fri, 25 Sep 2026 10:32:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1790332321; bh=EJresHg/KTaq7CipZM1uwmLP9w1K0/3rTIx060RDa40=; h=From:To:Cc:Subject:Date:Reply-To; b=PqcyWmf4nOb/smat6kUHrOmJWr3ukLrhWf3U3wZQYzG4cbEQRFzz0FV4wphgfA/W5 BU52Zl8G1O6WvYCKiBhljJCnqnM3aCk3ZquM+pTgiukmH6xBaFAGTpZYpSAUhyHSbr ARtuSZ5QQI7uCDyHRJH1929S6SjH7jel9ZpqEdOI= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2026-97941: mm/slab: take n->list_lock in __slab_try_return_freelist() to avoid race Date: Fri, 25 Sep 2026 12:24:04 +0200 Message-ID: <2026092512-CVE-2026-97941-4dbc@gregkh> X-Mailer: git-send-email 2.55.0 Reply-To: , Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3938; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=ezwm5u18rM0v7uYBAUuE1qWvUoHcGTJg8ZxCM5JXlWk=; b=owGbwMvMwCRo6H6F97bub03G02pJDFnbvEPk2O6++WUp/2nn94m3j02QLty36rr7wj2M2qX86 pt3SX362hHLwiDIxCArpsjyZRvP0f0VhxS9DG1Pw8xhZQIZwsDFKQATiXZgmB9f+S57TlD45YSG 8iMcC6qSFJfqTGeYpzSr9GRizudXlnM+8Zfsf/8kNaOIFQA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: mm/slab: take n->list_lock in __slab_try_return_freelist() to avoid race Commit ba7425312607 ("mm, slab: add an optimistic __slab_try_return_freelist()") incorrectly assumed that nobody has freed an object to the slab as long as slab->freelist is NULL and cmpxchg succeeds. However, as reported by Hyunwoo Kim [1], other CPUs might have freed an object to the slab, insert the slab to the partial list, then allocated an object from the slab, and be in the middle of removing the slab from the list under n->list_lock. Since __refill_objects_node() puts the slab back on pc.slabs outside n->list_lock, it might insert the slab into that list while the slab is concurrently being removed from n->partial. This led to a list corruption [1]: list_add corruption. next->prev should be prev (ffff888100000248), but was dead000000000122. (next=ffffea000416e410). kernel BUG at lib/list_debug.c:29! Oops: invalid opcode: 0000 [#1] SMP NOPTI CPU: 1 UID: 65534 PID: 144 Comm: poc Not tainted 7.2.0-16172-gcf72cbb39da8-dirty #1 PREEMPT(lazy) RIP: 0010:__list_add_valid_or_report+0x80/0xd0 ... Call Trace: alloc_from_new_slab+0x183/0x300 ___slab_alloc+0x31c/0x890 __kmalloc_noprof+0x3d4/0x800 lsm_blob_alloc+0x2d/0x50 security_msg_msg_alloc+0x26/0x90 load_msg+0x1aa/0x210 do_msgsnd+0x91/0x800 do_syscall_64+0x109/0x5d0 entry_SYSCALL_64_after_hwframe+0x77/0x7f ... Kernel panic - not syncing: Fatal exception This is a classic ABA problem where cmpxchg succeeds but the state has changed since __refill_objects_node() took the freelist from the slab. As Vlastimil Babka mentioned [2], it should be rare to return more than one slab (due to the racy read of slab->counters in get_partial_node_bulk()). Therefore, instead of introducing additional complexity, acquire and release n->list_lock twice in the worst case. Return the slab directly to the partial list and hold n->list_lock across the cmpxchg and add_partial(). This is similar to the initial version of commit ba7425312607 [3]. This is enough to avoid the race as the list manipulation is serialized by n->list_lock. While at it, bring back unlikely() hint now that the condition is unlikely. The Linux kernel CVE team has assigned CVE-2026-97941 to this issue. Affected and fixed versions =========================== Issue introduced in 7.2 with commit ba742531260782a2646bc031f9a12cafebc22594 and fixed in 7.2.7 with commit 570a6aaf6b52c6ec098f4811cdb52b1496f13d15 Issue introduced in 7.2 with commit ba742531260782a2646bc031f9a12cafebc22594 and fixed in 7.3-rc3 with commit 4a724bcf5d703e18957397914d79156fa2cf1174 Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community. Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at https://cve.org/CVERecord/?id=CVE-2026-97941 will be updated if fixes are backported, please check that for the most up to date information about this issue. Affected files ============== The file(s) affected by this issue are: mm/slub.c Mitigation ========== The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits: https://git.kernel.org/stable/c/570a6aaf6b52c6ec098f4811cdb52b1496f13d15 https://git.kernel.org/stable/c/4a724bcf5d703e18957397914d79156fa2cf1174