{"id":"AZL-118142","summary":"CVE-2026-143122 affecting package kernel 6.6.161.1-1","details":"In the Linux kernel, the following vulnerability has been resolved:\n\nperf/core: Do not resurrect cpuctx-\u003ecgrp after last cgroup event exit\n\nperf_cgroup_switch() relies on:\n\n    /*\n     * cpuctx-\u003ecgrp is set when the first cgroup event enabled,\n     * and is cleared when the last cgroup event disabled.\n     */\n\nIt computes the next task's cgroup, schedules out the CPU context and\nthen assigns cpuctx-\u003ecgrp unconditionally:\n\n    ctx_sched_out(&cpuctx-\u003ectx, NULL, EVENT_ALL|EVENT_CGROUP);\n    /*\n     * must not be done before ctxswout due\n     * to update_cgrp_time_from_cpuctx() in\n     * ctx_sched_out()\n     */\n    cpuctx-\u003ecgrp = cgrp;\n\nHowever, ctx_sched_out() can disable events itself. If a cgroup event\nhas a pending disable from perf_event_disable_inatomic() (e.g. its\nPERF_EVENT_IOC_REFRESH limit ran out) that the irq_work has not\nhandled yet, event_sched_out() consumes it inline:\n\n    if (event-\u003epending_disable) {\n        event-\u003epending_disable = 0;\n        perf_cgroup_event_disable(event, ctx);\n        state = PERF_EVENT_STATE_OFF;\n    }\n\nIf that was the last cgroup event, perf_cgroup_event_disable() clears\ncpuctx-\u003ecgrp:\n\n    if (--ctx-\u003enr_cgroups)\n        return;\n\n    cpuctx-\u003ecgrp = NULL;\n\nand perf_cgroup_switch() then sets it again. cpuctx-\u003ecgrp is left\nnon-NULL with ctx.nr_cgroups == 0, so the NULL check in\nperf_cgroup_switch() no longer catches it and the next switch trips:\n\n    WARN_ON_ONCE(cpuctx-\u003ectx.nr_cgroups == 0);\n\ncpuctx-\u003ecgrp does not hold a reference on the cgroup. Once that cgroup\nis removed, the next ctx_sched_in() dereferences the stale pointer:\n\n  BUG: KASAN: slab-use-after-free in ctx_sched_in+0xb1f/0xfa0\n  Read of size 8 at addr ffff8881008972d0 by task swapper/3/0\n\n  Tainted: [W]=WARN\n  Call Trace:\n   \u003cIRQ\u003e\n   ctx_sched_in+0xb1f/0xfa0\n   perf_event_sched_in+0x1a/0x70\n   ctx_resched+0x32b/0xac0\n   __perf_install_in_context+0x475/0xab0\n   remote_function+0x105/0x200\n   __flush_smp_call_function_queue+0x179/0x8d0\n   __sysvec_call_function_single+0x1b/0x1c0\n   sysvec_call_function_single+0x66/0x80\n   \u003c/IRQ\u003e\n   \u003cTASK\u003e\n   asm_sysvec_call_function_single+0x1a/0x20\n\nOnly assign cpuctx-\u003ecgrp when cgroup events remain after the context\nhas been scheduled out, so that it stays NULL as the invariant\nrequires.","modified":"2026-12-04T14:18:39.893039296Z","published":"2026-12-03T10:17:44Z","upstream":["CVE-2026-143122"],"references":[{"type":"WEB","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-143122"}],"affected":[{"package":{"name":"kernel","ecosystem":"Azure Linux:3","purl":"pkg:rpm/azure-linux/kernel"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"last_affected":"6.6.161.1-1"}]}],"database_specific":{"source":"https://github.com/microsoft/AzureLinuxVulnerabilityData/blob/main/osv/AZL-118142.json"}}],"schema_version":"1.9.2"}