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 768403815D5 for ; Thu, 25 Jun 2026 08:43:57 +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=1782377038; cv=none; b=QwdXc8oiH49wJ88sJbxd1+Al61Gib851Vyuw+4sAup2FiI+w5vWxYY/Fs1j3SwVFX27wsEazZdj94PayUu5pTmc+ES8eTopggglbhl3EaRm0B0k2iWqry698Gg5lT+vu3PVywqtxJozJMW44GYa3oHfLzGJT2elxeV9VsLNFs/g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782377038; c=relaxed/simple; bh=24z/NQUYuXSVvBw0a6SQrRgeKlyVETXsprwJFRgW9J0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=AswDMscy2+Ss8XTjg34h5UFMUYxUXEgVwFsQ2ymn/c3OjZts/fmcxgG3yBL8jxSba1FjbugeFLuzh2/hNCVcrORrE+0MD4oRnGYtyETwiYXcMXX0v9Os5xLFzzuua568WNvRVZdxHl40hPgswgp/aapYssHJrqZ/iHibeBdQV8c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=BMV/UCU1; 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="BMV/UCU1" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 698EA1F000E9; Thu, 25 Jun 2026 08:43:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1782377037; bh=8LaWNygugORQtTDbLfRyqxONj9DYePE89Zn9pUjUiFk=; h=From:To:Cc:Subject:Date:Reply-To; b=BMV/UCU1kOMIVoUjAMiq+kuROKSTArn+QsXRSxAF77UZRV7GsZzwSL84cig9Cj38I MZD9WvmGvBLJ+LC+0cTwC8kOVPJalmPNzgQfNKbnYidikVNKbQfBpbNAFMhQ913dmq N9YAuCyBDO+WYepayGoNyBenRgxI18A3WzHvHOKk= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2026-53162: memcg: use round-robin victim selection in refill_stock Date: Thu, 25 Jun 2026 09:40:10 +0100 Message-ID: <2026062550-CVE-2026-53162-477b@gregkh> X-Mailer: git-send-email 2.54.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=2793; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=FLsE/TInTQyMB9Q/TaplTiBQPl2ZhqtyhZb/33l025c=; b=owGbwMvMwCRo6H6F97bub03G02pJDFk2L8MiJAUOztgUd3erxbrCI95P3wj6nE16m6wrdnGN2 jzP4sfnO2JZGASZGGTFFFm+bOM5ur/ikKKXoe1pmDmsTCBDGLg4BWAiq68yzM+L/qitLbtjQohQ 0YId675JXdI+HMcwv2zrSu2qiY8nNQs7bRDrfhyq9kpzFwA= 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: use round-robin victim selection in refill_stock Harry Yoo reported that get_random_u32_below() is not safe to call in the nmi context and memcg charge draining can happen in nmi context. More specifically get_random_u32_below() is neither reentrant- nor NMI-safe: it acquires a per-cpu local_lock via local_lock_irqsave() on the batched_entropy_u32 state. An NMI that lands on a CPU mid-update of the ChaCha batch state and recurses into the random subsystem would corrupt that state. The memcg_stock local_trylock prevents re-entry on the percpu stock itself, but cannot protect an unrelated subsystem's per-cpu lock. Replace the random pick with a per-cpu round-robin counter stored in memcg_stock_pcp and serialized by the same local_trylock that already guards cached[] and nr_pages[]. No atomics, no random calls, no extra locks needed. The Linux kernel CVE team has assigned CVE-2026-53162 to this issue. Affected and fixed versions =========================== Issue introduced in 6.16 with commit f735eebe55f8f61758fe014bd0b02ab50b059e4d and fixed in 6.18.36 with commit 89bd8215e25aa6999cc51696da418e0d422bc5e0 Issue introduced in 6.16 with commit f735eebe55f8f61758fe014bd0b02ab50b059e4d and fixed in 7.0.13 with commit 00731bd7e18f182a32ca54d6b176eaa470b51ed7 Issue introduced in 6.16 with commit f735eebe55f8f61758fe014bd0b02ab50b059e4d and fixed in 7.1 with commit c0cafe24d3f6534294c4b2bc2d47734ff7cbd313 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-53162 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/89bd8215e25aa6999cc51696da418e0d422bc5e0 https://git.kernel.org/stable/c/00731bd7e18f182a32ca54d6b176eaa470b51ed7 https://git.kernel.org/stable/c/c0cafe24d3f6534294c4b2bc2d47734ff7cbd313