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 774EC38F244 for ; Sat, 25 Jul 2026 08:58:11 +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=1784969892; cv=none; b=hfMw0evl3l3DcndUMyR9JTrT2XehG5VpW/NPG50m893F3FNIK8amIaf5xNi2EKwzeHW+grHV9M3oZQTwvq8TMqET3K+fwwKj02pYPx7ZK9jqf2ihvspIaS/yz2OWc02u+k9endgQA8ZWXfp7DPh7nlkaYpyZ4ofsjRLg7OzRpuw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784969892; c=relaxed/simple; bh=1u6mBr0Aemo0jVDX0xaKgb1aaqq9JVqdq88YClRHEN4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=fjh444BSl54JiR5xbjMos4XvauyPxTvQCB8ytQ7zf0G86d27HXDHbWWOifxXcmZsFAyHxlHlAq/Ic7Q7Ih00rH3opsXHUXXqcm36GVPHKXpZXZOWRFeAsGpKc2hW+RaQwjaM7D2sUHvviIrgC1CJxpJ2ccWcalilQ3IZjgh/Oyo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=RYIXHALm; 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="RYIXHALm" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D9BAC1F000E9; Sat, 25 Jul 2026 08:58:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1784969891; bh=SojDoZNXtMB1Uwte3qN6mu6prtC1etNd+uF96va3CaY=; h=From:To:Cc:Subject:Date:Reply-To; b=RYIXHALmhkXyjYVDS2j9tXZqf7ZGMHl3EvsZJD+wTreptt29tyB3uUkDqO9xFBNqA AN7WRk+5CBa4k4EjW0OfhhXke42JrZu/8Qz2UzDRe2UKA4U8Livx/GdT+UlyNtrSfu BTTXUbgDjN8mZM6hyCSxj4xHy54MxSjAr0M2MW+0= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2026-64418: mm: shrinker: fix shrinker_info teardown race with expansion Date: Sat, 25 Jul 2026 10:50:35 +0200 Message-ID: <2026072533-CVE-2026-64418-4aed@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=4361; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=HKfz7bCCBkoP3GKXmQLzlA9X8VNwNOc/fSMzwrilLQE=; b=owGbwMvMwCRo6H6F97bub03G02pJDFkpFUkyP/fpO4r0rc2MuRvfuSx8/e13PIuPJHQym/ByH 7lQldDZEcvCIMjEICumyPJlG8/R/RWHFL0MbU/DzGFlAhnCwMUpABPZeYFhnv3M90f3TJ8w2XX6 temPXs3YkHWafyvDgobf5sE8/c+4sw9ezDwhazjtyd47nQA= 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: shrinker: fix shrinker_info teardown race with expansion expand_shrinker_info() iterates all visible memcgs under shrinker_mutex, including memcgs that have not finished ->css_online() yet. Once pn->shrinker_info has been published, teardown must stay serialized with expand_shrinker_info() until that memcg is either fully online or no longer visible to iteration. Today alloc_shrinker_info() breaks that rule by dropping shrinker_mutex before freeing a partially initialized shrinker_info array, which may cause the following race: CPU0 CPU1 ==== ==== css_create --> list_add_tail_rcu(&css->sibling, &parent_css->children); online_css --> mem_cgroup_css_online --> alloc_shrinker_info --> alloc node0 info rcu_assign_pointer(C->node0->shrinker_info, old0) alloc node1 info -> FAIL -> goto err mutex_unlock(shrinker_mutex) shrinker_alloc() --> shrinker_memcg_alloc --> mutex_lock(shrinker_mutex) expand_shrinker_info --> mem_cgroup_iter see the memcg expand_one_shrinker_info --> old0 = C->node0->shrinker_info memcpy(new->unit, old0->unit, ...); free_shrinker_info --> kvfree(old0); /* double free !! */ kvfree_rcu(old0, rcu); The same problem exists later in mem_cgroup_css_online(). If alloc_shrinker_info() succeeds but a subsequent objcg allocation fails, the free_objcg -> free_shrinker_info() unwind path tears down the already published pn->shrinker_info arrays without shrinker_mutex. The expand_one_shrinker_info() can race with that teardown in the same way, leading to use-after-free or double-free of the old shrinker_info. Fix this by serializing shrinker_info teardown with shrinker_mutex, and by keeping alloc_shrinker_info() error cleanup inside the locked section. The Linux kernel CVE team has assigned CVE-2026-64418 to this issue. Affected and fixed versions =========================== Issue introduced in 6.7 with commit 307bececcd1205bcb67a3c0d53a69db237ccc9d4 and fixed in 6.12.96 with commit b9a280a9a454ed514636351d53fe2a233dc5054b Issue introduced in 6.7 with commit 307bececcd1205bcb67a3c0d53a69db237ccc9d4 and fixed in 6.18.39 with commit 6465ff3ce65131c774a312d450abe10f4b9f3875 Issue introduced in 6.7 with commit 307bececcd1205bcb67a3c0d53a69db237ccc9d4 and fixed in 7.1.4 with commit 284c267f013e45d8c89d9fb9373105dc8e6c0947 Issue introduced in 6.7 with commit 307bececcd1205bcb67a3c0d53a69db237ccc9d4 and fixed in 7.2-rc3 with commit 65476d31d8056e859c48580f82295ce159196ffe 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-64418 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/shrinker.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/b9a280a9a454ed514636351d53fe2a233dc5054b https://git.kernel.org/stable/c/6465ff3ce65131c774a312d450abe10f4b9f3875 https://git.kernel.org/stable/c/284c267f013e45d8c89d9fb9373105dc8e6c0947 https://git.kernel.org/stable/c/65476d31d8056e859c48580f82295ce159196ffe