From mboxrd@z Thu Jan 1 00:00:00 1970 From: AL-KERNEL To: kernel-cve@kernelcve.org Subject: [CVE-2026-53162][MODERATE 7.0] memcg: use round-robin victim selection in refill_stock Date: Fri, 26 Jun 2026 03:30:13 -0400 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-AL-KERNEL-CVE: CVE-2026-53162 X-AL-KERNEL-Priority: MODERATE 7.0 X-AL-KERNEL-Severity: MODERATE 7.0 X-AL-KERNEL-Base-Severity: MODERATE X-AL-KERNEL-KPANIC: NO X-AL-KERNEL-ActionableScore: 5 X-AL-KERNEL-ActionableScore-Lower: 2 X-AL-KERNEL-Commit: 89bd8215e25aa6999cc51696da418e0d422bc5e0 List-Id: CVE: CVE-2026-53162 Priority: MODERATE 7.0 AL-KERNEL base severity: MODERATE KPANIC flag: NO Patch: memcg: use round-robin victim selection in refill_stock Commit: 89bd8215e25aa6999cc51696da418e0d422bc5e0 Upstream patch: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=89bd8215e25aa6999cc51696da418e0d422bc5e0 Original CVE announcement: https://lore.kernel.org/linux-cve-announce/?q=CVE-2026-53162 Analysis date: Fri, 26 Jun 2026 03:30:13 -0400 ActionableScore: 5 ActionableScore lower bound: 2 Actionable bucket: Actionable Moderate at minimum Manual review required: NO Summary: `memcg refill_stock could call get_random_u32_below from NMI context, allowing NMI reentry to corrupt per CPU random subsystem state under a narrow timing window, with local high complexity triggering and possible system-wide randomness integrity impact.` ====================================================================== ABOUT THIS REPORT ====================================================================== The original Linux kernel CVE announcement for CVE-2026-53162 is available here: https://lore.kernel.org/linux-cve-announce/?q=CVE-2026-53162 The original announcement does not normally provide a security severity estimate, CVSS assessment, or enough information to determine whether the reported kernel bug represents a practically relevant security issue. This report was generated by AL-KERNEL, an AI-assisted Linux kernel vulnerability analysis system developed by Alexander Larkin. It combines an autonomous classifier with LLM-assisted technical analysis and a separate ActionableScore mechanism. The purpose of this report is to prioritize Linux kernel CVEs before manual review, identify cases that require prompt investigation, and support automatic closure of issues that are unlikely to have meaningful security impact. Published priority for this report: MODERATE 7.0 Manual review required: NO A detailed explanation of the methodology and priority rules is included at the end of this message. ====================================================================== AL-KERNEL CLASSIFICATION RESULT ====================================================================== CVE-2026-53162 MODERATE CHECK Maybe valid. Check manually. Hints by AL-KERNEL: The best (paranoid) CVSS is 'AV:L/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:H';CWE-362;CWE-667;CWE-662;Other CVSS 'AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:L';BEST CVSS score: '5.8';DESCR 'memcg refill_stock could call get_random_u32_below from a path that may run in NMI context. get_random_u32_below is not NMI safe because it uses per CPU batched random state protected only against normal interrupt context, so NMI reentry during a ChaCha batch update can corrupt random subsystem state. For the CVSS the PR:L is used because a local process is needed to create memory charge activity in a memcg, while the exact NMI timing makes exploitation high complexity. The issue is not network reachable. Impact is primarily local denial of service or random state corruption, with paranoid limited confidentiality and integrity impact because corrupted random state may affect security sensitive randomness.';YES REQUIRES MANUAL CHECK; ,and ActionableScore result is Actionable Moderate at minimum (with actual score 4) SKIP CVE-2026-53162 SKIP The Fixes patch not applied yet, so unlikely that actual: f735eebe55f8f61758fe014bd0b02ab50b059e4d YES NO NO unknown MAYBE SIMPLEFIX HARDWARE LINUS MEMORY DECREASED_TO_MODERATEREG_BASED_ON_ACTIONABLESCORELESSTHAN5 - - checked ====================================================================== ACTIONABLESCORE ANALYSIS ====================================================================== ActionableScore=5 ActionableScoreLower=2 ## 1. ActionableScore * Conservative score: 2 * Paranoid score: 5 * Final recommended bucket: **Actionable Moderate at minimum**:: ## 2. Signal breakdown Conservative signals: * Local unprivileged trigger: +1. A local process can create memcg charge and refill activity, although the exact NMI timing is not directly controlled. * Memory corruption, Weak/indirect corruption candidate: +1. The patch describes corruption of per CPU random subsystem state via NMI reentry, but not UAF, OOB write, arbitrary write, or attacker controlled overwrite. * Broad/default/common subsystem: +1. memcg and the random subsystem are core kernel facilities and commonly present. * Hard or unreliable race / special timing required: -1. The issue requires an NMI to hit during a narrow random batch update window and recurse into the random subsystem. Paranoid additional signals: * Confidentiality impact plausible: +1. Corruption of kernel random state may affect security sensitive randomness, although no direct disclosure primitive is shown. * Integrity impact plausible: +1. Corrupted random state may affect correctness or unpredictability of future random outputs. * Availability impact realistic: +1. Random state corruption in kernel context is system-wide and may plausibly cause instability, even though a reliable crash is not demonstrated. Not counted: * No remote reachable signal. The affected path is local kernel memory accounting plus NMI context, not a network protocol path. * No strong LPE plausibility. The patch does not show UAF reclaim, controlled overwrite, refcount takeover, or object confusion. * No strong generic memory corruption. The corruption is of subsystem state, not a demonstrated memory safety primitive. * No reliable kernel crash signal. The commit describes state corruption risk, not a reproducible panic path. ## 3. Reachability analysis A local user or process can plausibly influence memcg charging patterns by allocating and freeing memory inside a memory cgroup. The difficult part is causing or aligning the NMI recursion into `get_random_u32_below()` while the same CPU is updating the per CPU batched ChaCha random state. In typical deployments this is not remotely reachable and does not require CAP_SYS_ADMIN merely to create memory pressure, but reliable triggering may depend on local NMI sources, perf configuration, hardware events, or system workload. Containers can increase practical exposure because memcg activity is common in containerized environments, but the NMI timing requirement keeps exploitability high complexity. ## 4. Severity interpretation This behaves more like an actionable Moderate than an Important-class vulnerability. The technically concerning part is that an NMI-unsafe random API could corrupt kernel random subsystem state, which is more sensitive than an ordinary warning or resource leak. However, the patch does not establish a direct privilege escalation primitive, attacker controlled memory overwrite, information leak, or reliable crash. The conservative interpretation is a low scoring local hard-race state-corruption issue. The paranoid interpretation reaches Actionable Moderate because random state corruption may affect confidentiality and integrity indirectly and should not be auto-closed without review. ## 5. One-sentence report phrase `memcg refill_stock could call get_random_u32_below from NMI context, allowing NMI reentry to corrupt per CPU random subsystem state under a narrow timing window, with local high complexity triggering and possible system-wide randomness integrity impact.` ## 6. Manual review recommendation MANUAL CHECK RECOMMENDED The issue does not show a strong memory corruption or LPE primitive, but it affects the kernel random subsystem from NMI context and has enough security sensitivity to justify manual review rather than automatic closure. ====================================================================== UPSTREAM PATCH SUMMARY ====================================================================== Patch: memcg: use round-robin victim selection in refill_stock Commit: 89bd8215e25aa6999cc51696da418e0d422bc5e0 Upstream URL: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=89bd8215e25aa6999cc51696da418e0d422bc5e0 Commit description: 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. Link: https://lore.kernel.org/20260521223751.3794625-1-shakeel.butt@linux.dev Fixes: f735eeb ("memcg: multi-memcg percpu charge cache") Signed-off-by: Shakeel Butt Reported-by: Harry Yoo Closes: https://lore.kernel.org/4e20f643-6983-4b6e-b12d-c6c4eb20ae0c@kernel.org/ Acked-by: Harry Yoo (Oracle) Acked-by: Michal Hocko Cc: Johannes Weiner Cc: Muchun Song Cc: Roman Gushchin Cc: Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman Changed files: mm/memcontrol.c Diff excerpt: Not included in this email. See the upstream URL for the full patch. Full patch: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=89bd8215e25aa6999cc51696da418e0d422bc5e0 ====================================================================== DETAILED REPORT METHODOLOGY ====================================================================== The original Linux kernel CVE announcement for CVE-2026-53162 can be found here: https://lore.kernel.org/linux-cve-announce/?q=CVE-2026-53162 The original CVE announcement normally does not include a security-level estimate. In particular, it may not contain a CVSS assessment, an impact level, or enough information to determine whether the reported bug is a practically relevant security issue. One purpose of this parallel CVE list is to provide that missing technical and prioritization information. The original goal of the AL-KERNEL project was to prioritize Linux kernel CVE analysis automatically before manual review. The system can also help identify non-security issues that may be suitable for automatic closure. This report was generated by AL-KERNEL, an AI-assisted Linux kernel vulnerability analysis system developed by Alexander Larkin. The first analysis stage combines an autonomous classifier with additional LLM-based analysis. The autonomous classifier runs locally on a CPU and is based on a backpropagation neural network. Together, these mechanisms produce a technical vulnerability description, identify likely weakness types, estimate CVSS severity, and provide input for ActionableScore. Two CVSS estimates are retained because incomplete kernel vulnerability information often permits more than one defensible interpretation: Conservative CVSS vector: AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:L The Best / paranoid CVSS vector: AV:L/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:H The Best / paranoid CVSS score: 5.8 The conservative vector represents a lower-impact interpretation. The Best/paranoid vector intentionally represents a plausible upper-bound interpretation and should not automatically be treated as demonstrated real-world impact. CVSS may also need to be adjusted for a particular Linux deployment, because actual reachability, privileges, enabled kernel configuration, hardware, namespaces, exposed device nodes, and other environmental conditions can differ significantly between systems. A separate ActionableScore mechanism evaluates practical remediation urgency. Its analysis may include reachability, attack prerequisites, subsystem exposure, memory-corruption characteristics, denial-of-service reliability, and possible confidentiality, integrity, or privilege-escalation impact. Conservative ActionableScore: 2 Paranoid ActionableScore: 5 The final base severity is taken directly from the second tab-separated field of the AL-KERNEL classification result. ActionableScore does not replace or independently override that final AL-KERNEL decision, and if ActionableScore adjusted impact level of ALKERNEL, then you would see self-readable flags above like INCREASED_TO_HIGH_BASED_ON_ACTIONABLESCOREHIGHEREQTHAN7. For an AL-KERNEL result of MODERATE, this report uses the following additional presentation split: ActionableScore below 5 -> MODERATE REGULAR ActionableScore 5 or more -> MODERATE 7.0 The distinction between MODERATE REGULAR and MODERATE 7.0 makes it possible to identify Moderate issues that should receive manual analysis and fixes before lower-priority MODERATE REGULAR issues. In many cases, MODERATE REGULAR fixes may wait for a later rebase or routine update. There is one override in which MODERATE REGULAR becomes MODERATE 7.0 even when the ActionableScore is below 5. When the AL-KERNEL result contains the KPANIC flag, a MODERATE result is always presented as MODERATE 7.0. The KPANIC flag selected with few regexps without usage of AI at all, so it helps to detect cases when Kernel Crash happens and similar (to filter False-Negative results from the LLM usage). KPANIC indicates that a reliable kernel crash, kernel panic, or similarly serious kernel availability impact was identified by the classification workflow. AL-KERNEL base severity for this report: MODERATE KPANIC detected for this report: NO Published priority for this report (same as in Subject): MODERATE 7.0 These results are intended to support engineering triage. They are machine-generated estimates, and cases marked for manual review should be validated by a human security engineer before final disposition. For more info read docs linked from here: https://kernelcve.org/ (and you can submit you own patch there to generate such a report for non-existant CVE-id yet). Note that in many cases this AI tool selects higher severity, than real is (means you can expect Importants instead of Moderate 7.0 or Moderates 7.0 instead of regular Moderates). If you see such cases, please use reply email interface to add additional manual analyses info to this particular CVE. And please, please, let me know when you see Lows instead of Importants or Important instead of Low (because particular for such cases I need to tune this AI tool to make it better for this one and next similar). My contact email for such notifications is alexanjelausa@gmail.com (and both send reply to CVE record itself too and see "reply" button below for howto reply).