CVE-2026-98477: perf/core: Fix NULL pmu_ctx passed to pmu->sched_task()
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
perf/core: Fix NULL pmu_ctx passed to pmu->sched_task()
perf_pmu_sched_task() returns early when cpuctx->task_ctx is set, and cpc->task_epc is only non-NULL while a task context is scheduled in on this CPU. __perf_pmu_sched_task() therefore always passes NULL:
Unable to handle kernel NULL pointer dereference at virtual address 00 pc : armv8pmu_sched_task+0x14/0x50 Call trace: armv8pmu_sched_task+0x14/0x50 (P) perf_pmu_sched_task+0xac/0x108 __perf_event_task_sched_out+0x6c/0xe0
Pass &cpc->epc instead, the CPU-wide context for this PMU, which the function already dereferences a few lines up to find pmu.
armv8pmu_sched_task() is the only in-tree implementation that dereferences the argument, and it only reads ->pmu, so the oops needs BRBE, added in v6.17.
The Linux kernel CVE team has assigned CVE-2026-98477 to this issue.
Affected and fixed versions
===========================
Issue introduced in 6.2 with commit bd27568117664b8b3e259721393df420ed51f57b and fixed in 6.12.112 with commit b5409311b606d536cc485f3706c242c2afa93edb Issue introduced in 6.2 with commit bd27568117664b8b3e259721393df420ed51f57b and fixed in 6.18.55 with commit 249a2bd87a0e57dc28f36e992807edc9cae309b5 Issue introduced in 6.2 with commit bd27568117664b8b3e259721393df420ed51f57b and fixed in 7.2.9 with commit ec15f6a50183fc01f470af74ad49900fb3731fca Issue introduced in 6.2 with commit bd27568117664b8b3e259721393df420ed51f57b and fixed in 7.3-rc5 with commit 36bb85cf36cab15fb611cb44b78a5df06e4e69a2
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-98477
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:
kernel/events/core.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/b5409311b606d536cc485f3706c242c2afa93edb https://git.kernel.org/stable/c/249a2bd87a0e57dc28f36e992807edc9cae309b5 https://git.kernel.org/stable/c/ec15f6a50183fc01f470af74ad49900fb3731fca https://git.kernel.org/stable/c/36bb85cf36cab15fb611cb44b78a5df06e4e69a2