{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-99697","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","state":"PUBLISHED","assignerShortName":"Linux","dateReserved":"2026-09-25T10:25:14.429Z","datePublished":"2026-11-20T05:50:40.353Z","dateUpdated":"2026-11-22T11:09:47.872Z"},"containers":{"cna":{"providerMetadata":{"orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","shortName":"Linux","dateUpdated":"2026-11-22T11:09:47.872Z"},"descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nmm: memcontrol: fix NULL pointer deref and UAF from high_work_func() on dying memcg\n\nWhen memory.high is exceeded in non-task context, try_charge_memcg()\nschedules memcg->high_work without taking a reference on the memcg, and\nhigh_work_func() invokes reclaim_high() without pinning the memcg.\n\nWith obj_cgroup reparenting, introduced in commit bf4f059954dc (\"mm:\nmemcg/slab: obj_cgroup API\"), objects charged to a child memcg are\nreparented to its parent in mem_cgroup_css_offline() instead of holding a\nreference on the child until uncharged.  Subsequent uncharges of those\nobjects go to the parent, which can leave the child's memory use\npermanently above its high limit, so any later charge on the offlined\nmemcg in non-task context schedules high_work.  This was later widened\nfrom kernel memory to LRU folios when commit f1cf8d2f36dc (\"mm:\nmemcontrol: eliminate the problem of dying memory cgroup for LRU folios\")\nconverted LRU folios to use obj_cgroup reparenting.\n\ncancel_work_sync(&memcg->high_work) only runs at the end of teardown in\nmem_cgroup_css_free(), so high_work_func() can start or still be running\nreclaim_high() after mem_cgroup_css_released() or shrink_many() has called\nlru_gen_release_memcg() and unhashed lruvec->lrugen.list.  If reclaim\ntries to rotate the memcg, lru_gen_rotate_memcg() dereferences a NULL\npprev pointer.  This issue is specific to MGLRU and was introduced with\nthe memcg LRU in commit e4dde56cd208 (\"mm: multi-gen LRU: per-node\nlru_gen_folio lists\").\n\nWith either traditional LRU or MGLRU, css_free_rwork_fn() calls\ncss_rstat_exit() which frees per-CPU rstat data before calling\nmem_cgroup_css_free().  If reclaim_high() is still running, rstat updates\nvia mod_lruvec_state() -> __css_rstat_updated() cause a use-after-free on\nthe per-CPU rstat data.  This was introduced when commit 5da3bfa029d6\n(\"cgroup: use separate rstat trees for each subsystem\") moved\ncss_rstat_exit() ahead of ss->css_free().\n\nFix both problems by acquiring a reference with css_tryget_online() in\nhigh_work_func() before calling reclaim_high(), and by resetting\nmemory.high and swap.high to PAGE_COUNTER_MAX in mem_cgroup_css_offline()\nso that charges via references on an offlined memcg do not trigger\nhigh_work on the dead child and skip checking live ancestors in\ntry_charge_memcg().\n\nAcquiring the reference in high_work_func() rather than before scheduling\nhigh_work is safe because mem_cgroup_css_free() calls irq_work_sync() and\ncancel_work_sync() which cancels pending work and waits for an already\nrunning high_work_func() to complete before mem_cgroup_free() frees the\nmemcg.  css_tryget_online() uses percpu_ref_tryget_live() and is safe to\ncall after percpu_ref_exit() before the cgroup is freed unlike\ncss_tryget().\n\nOops: general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [#1] SMP KASAN NOPTI\nKASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007]\nCPU: 1 UID: 0 PID: 27 Comm: kworker/1:0 Tainted: G    B   W           7.3.0-rc5-g2bba28e98578 #284 PREEMPT(full)\nTainted: [B]=BAD_PAGE, [W]=WARN  <-- Taint from lru_gen_rotate_memcg() VM_WARN_ON_ONCE\nHardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.17.0-debian-1.17.0-1 04/01/2014\nWorkqueue: events high_work_func\nRIP: 0010:lru_gen_rotate_memcg+0x1a3/0xe90\nCall Trace:\n <TASK>\n ? read_ctrl_pos+0x22f/0x3f0\n shrink_lruvec+0x16cb/0x1b80\n ? ret_from_fork_asm+0x1a/0x30\n ? lapic_next_event+0x15/0x20\n ? clockevents_program_event+0x2bb/0x6f0\n ? lapic_next_event+0x15/0x20\n ? __pfx_shrink_lruvec+0x10/0x10\n ? __pfx_clockevents_program_event+0x10/0x10\n ? _raw_spin_lock+0x84/0xe0\n ? __pfx__raw_spin_lock+0x10/0x10\n ? kasan_save_stack+0x30/0x50\n ? psi_group_change+0x381/0x740\n ? __pfx_sched_clock_cpu+0x10/0x10\n ? save_fpregs_to_fpstate+0xc4/0x2c0\n ? finish_task_switch.isra.0+0x1de/0xac0\n ? __schedule+0xf62/0x42c0\n ? __pfx___schedule+0x10/0x10\n ? __pfx___irq_work_queue_lo\n---truncated---"}],"metrics":[{"cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","baseScore":7.8,"baseSeverity":"HIGH"},"scenarios":[{"lang":"en","value":"AV:L - try_charge_memcg() queues memcg->high_work when a charge exceeds memory.high and !in_task(). A local user reaches that from UDP receive softirq: __udp_queue_rcv_skb -> __udp_enqueue_schedule_skb -> udp_rmem_schedule -> __sk_mem_schedule -> mem_cgroup_sk_charge on the socket's sk_memcg. Setting memory.high and rmdir are local cgroup writes; the datagram only causes the charge.\nAC:L - The attacker writes memory.high, charges past it, pins the css via mem_cgroup_sk_alloc(), and rmdirs so memcg_reparent_objcgs() leaves the child counter above high. A further datagram takes the !in_task() branch in try_charge_memcg() and queues high_work, while closing the socket drops the last ref. That races reclaim_high() with lru_gen_release_memcg() and css_rstat_exit(); the attacker starts both sides and can retry.\nPR:L - memory_high_write() and cgroup_mkdir() have no capable() check. memory.high is created mode 0644 as current_fsuid (cgroup_file_mode/cgroup_add_file), and cgroup_may_write() only tests MAY_WRITE on cgroup.procs. An unprivileged user who can write a delegated cgroup v2 directory, the usual user-session and container setup, can create the child, set memory.high, and remove it.\nUI:N - The attacker alone performs the mkdir, the memory.high write, the socket that pins sk_memcg, the datagram that charges in softirq, and the rmdir that starts teardown.\nS:U - The corrupted objects are the host memcg's css_rstat_cpu and lruvec->lrugen.list. high_work_func() and reclaim_high() run in that same host kernel.\nC:H - css_free_rwork_fn() frees css->rstat_cpu in css_rstat_exit() before mem_cgroup_css_free() calls cancel_work_sync(). Reclaim still inside high_work_func() reaches count_memcg_events() on the dying lruvec, which calls memcg_rstat_updated() -> __css_rstat_updated() and reads the freed css_rstat_cpu.lnode; reuse of that percpu slot lets a later flush follow rstatc->owner.\nI:H - __css_rstat_updated() try_cmpxchg's lnode.next in the freed percpu css_rstat_cpu and llist_add's that node onto the memory controller's rstat list, writing reclaimed percpu memory and leaving a dangling css for css_process_update_tree() to walk.\nA:H - The reported oops is a NULL pprev deref in lru_gen_rotate_memcg()'s hlist_nulls_del_rcu() after lru_gen_release_memcg() unhashed lruvec->lrugen.list, on the high_work_func -> reclaim_high -> shrink_lruvec path. That general-protection fault kills the kernel; the rstat use-after-free can fault as well."}]}],"affected":[{"product":"Linux","vendor":"Linux","defaultStatus":"unaffected","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["mm/memcontrol.c"],"versions":[{"version":"e4dde56cd208674ce899b47589f263499e5b8cdc","lessThan":"a44855f25821082e384503abf01a45a5c65a80de","status":"affected","versionType":"git"},{"version":"e4dde56cd208674ce899b47589f263499e5b8cdc","lessThan":"301ac490daf619b8affe12b07e2d68c99adcda79","status":"affected","versionType":"git"},{"version":"e4dde56cd208674ce899b47589f263499e5b8cdc","lessThan":"b558ac673e65b4f302f105a0d9f79fb7cf012330","status":"affected","versionType":"git"},{"version":"e4dde56cd208674ce899b47589f263499e5b8cdc","lessThan":"dd94d8c7660a60dbfcd425e0d10120de6d02a7bd","status":"affected","versionType":"git"}]},{"product":"Linux","vendor":"Linux","defaultStatus":"affected","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["mm/memcontrol.c"],"versions":[{"version":"6.3","status":"affected"},{"version":"0","lessThan":"6.3","status":"unaffected","versionType":"semver"},{"version":"6.12.118","lessThanOrEqual":"6.12.*","status":"unaffected","versionType":"semver"},{"version":"6.18.64","lessThanOrEqual":"6.18.*","status":"unaffected","versionType":"semver"},{"version":"7.3.5","lessThanOrEqual":"7.3.*","status":"unaffected","versionType":"semver"},{"version":"7.4-rc2","lessThanOrEqual":"*","status":"unaffected","versionType":"original_commit_for_fix"}]}],"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.3","versionEndExcluding":"6.12.118"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.3","versionEndExcluding":"6.18.64"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.3","versionEndExcluding":"7.3.5"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.3","versionEndExcluding":"7.4-rc2"}]}]}],"references":[{"url":"https://git.kernel.org/stable/c/a44855f25821082e384503abf01a45a5c65a80de"},{"url":"https://git.kernel.org/stable/c/301ac490daf619b8affe12b07e2d68c99adcda79"},{"url":"https://git.kernel.org/stable/c/b558ac673e65b4f302f105a0d9f79fb7cf012330"},{"url":"https://git.kernel.org/stable/c/dd94d8c7660a60dbfcd425e0d10120de6d02a7bd"}],"title":"mm: memcontrol: fix NULL pointer deref and UAF from high_work_func() on dying memcg","x_generator":{"engine":"bippy-1.2.0"}}}}