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 93B2F530E13 for ; Wed, 14 Oct 2026 13:31:24 +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=1791984692; cv=none; b=EeK+nP5VTXSJ3M+kufVJqXocwa5erKnkta+TZCoFvjQUhmEbxxbb+PvDRy+LpsSI+iCsMeN4QXTojM0ejm7lvwBkJgN9jb/6fDInr0LH9pVzVG9U5IRfiPTppj/gnM4tSGafeu186i3NTExQzRlVi5dWV+DabO27XNyBEwAJCsU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791984692; c=relaxed/simple; bh=JaQ+J5mnMTcKBFor/GYovshien1lfLoPdq3PeSR+kGA=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Yup4w4zPWj4AFKGImmpkkN/UeeqCbDpgjvSyohXksu/DwRjrlFCa0mpiKwh0loJZNzSEDudMFBb7MShYltnhXR9tTgmAD1MU1fwOvIdYVmfIOloXac31sxc4f4vgkUsoHnW8b+eDnehNYRv1gqGBpL50WLjitRMAOhq7IB8I2FY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=dytznoPg; 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="dytznoPg" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E56801F00898; Wed, 14 Oct 2026 13:31:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1791984684; bh=bqU2OeYZqm5N+oZUbudDLQ/h5HN42PNoQNSaZEEJ61g=; h=From:To:Cc:Subject:Date:Reply-To; b=dytznoPg4ISs1TVdelfF+bEbVDUYbV8xQpabUlKJYpOSZHLevpzZPt9+3lK7M9rwj NtI95KAF1jWIGejjS0LdhxJCp5vMFlv81wpx5zqKpcj4ZbtkYB5VGAKbJdrq8pLlqD rRgfgoaxporB9KZlhVZdBdaGiHOFlC7DL6dAhc2Y= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2026-98414: memcg: avoid charging the root memcg from obj_cgroup_charge_pages() Date: Wed, 14 Oct 2026 15:30:12 +0200 Message-ID: <2026101405-CVE-2026-98414-0688@gregkh> X-Mailer: git-send-email 2.56.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=4296; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=pPF1itXU/pWqrwXLiWDaEmAr7H91GLNiRhKMwikCtQs=; b=owGbwMvMwCRo6H6F97bub03G02pJDFnnm+/WvHoUYdYpEVnXvPbcK7bQuy3277RXfOPZHKWR1 2uz+8WsjlgWBkEmBlkxRZYv23iO7q84pOhlaHsaZg4rE8gQBi5OAZiIzXyGeeb/jrj0vHwpK9se 2rt5/33f3dqvuRkWnD/96ckEvt6+g479nQpnbgUvY81eDAA= 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: memcg: avoid charging the root memcg from obj_cgroup_charge_pages() obj_cgroup_charge_pages() resolves the objcg to its memcg and calls try_charge_memcg(), which does not short circuit the root memcg. That memcg can be the root memcg: obj_cgroup_is_root() reflects the memcg the objcg was created for and is never updated, while memcg_reparent_objcgs() does redirect objcg->memcg to the parent on rmdir. An objcg of a dying child of root therefore passes every obj_cgroup_is_root() filter but resolves to the root memcg. Folios keep the objcg they were charged with, so this is easy to reach through zswap: allocate anon memory in a cgroup, move the task out, remove the cgroup, then write to the root cgroup's memory.reclaim. The reclaimed folios are charged through the reparented objcg and end up in refill_stock() with the root memcg: WARNING: mm/memcontrol.c:2198 at refill_stock+0x644/0x940 refill_stock+0x644/0x940 try_charge_memcg+0x12d6/0x1570 __obj_cgroup_charge+0x35/0xf0 obj_cgroup_charge+0x1de/0x210 obj_cgroup_charge_zswap+0x83/0x270 zswap_store+0x1620/0x2000 swap_writeout+0x94c/0x14c0 shrink_folio_list+0x3388/0x52b0 [...] try_to_free_mem_cgroup_pages+0x30d/0x830 user_proactive_reclaim+0x504/0x840 memory_reclaim+0x1f/0x30 Beyond the warning, the charge is asymmetric: obj_cgroup_uncharge_pages() skips refill_stock() for the root memcg, so the root's page counter grows and is never uncharged. It is not user visible, since memory.current is not exposed on the root, but it is a leak. Use try_charge(), which returns early for the root memcg, restoring the symmetry with obj_cgroup_uncharge_pages(). The above sequence was scripted into a standalone reproducer (zswap on, swap on a virtio disk, 512MB of anon memory faulted in inside a child of the root cgroup, the task then migrated to the root cgroup, the child removed, followed by "echo 600M swappiness=max > memory.reclaim" on the root) and run in a CONFIG_DEBUG_VM=y VM. It reproduces the splat on the first zswap store of a reparented folio, with the same call chain as the report. With this patch applied the splat is gone while the zswap store count over the run is unchanged, so the same path is still exercised. cgroup selftests test_zswap, test_kmem and test_memcontrol show no new failures. The Linux kernel CVE team has assigned CVE-2026-98414 to this issue. Affected and fixed versions =========================== Issue introduced in 6.15 with commit 20d6c17252282c3af261d1cde8e34def1b2458c8 and fixed in 6.18.54 with commit d5cdff14c385bf42d03c0dd4c3e88ddf4c28b8a9 Issue introduced in 6.15 with commit 20d6c17252282c3af261d1cde8e34def1b2458c8 and fixed in 7.2.8 with commit ecc03877b1b05cb1e3a72175ccb868383eccc518 Issue introduced in 6.15 with commit 20d6c17252282c3af261d1cde8e34def1b2458c8 and fixed in 7.3-rc4 with commit 6e673d0879ef78c395cfe0d3ba316690a60055d8 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-98414 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/memcontrol.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/d5cdff14c385bf42d03c0dd4c3e88ddf4c28b8a9 https://git.kernel.org/stable/c/ecc03877b1b05cb1e3a72175ccb868383eccc518 https://git.kernel.org/stable/c/6e673d0879ef78c395cfe0d3ba316690a60055d8