CVE-2026-98552: perf/core: Fix a refcount leak in attach_perf_ctx_data()
In the Linux kernel, the following vulnerability has been resolved:
perf/core: Fix a refcount leak in attachperfctxdata()
The attachperfctxdata() can race on global and !global cases. The global case is protected by globalctxdatarwsem and shares a single reference count using perfctxdata.global field.
But when it races with !global case, it may miss to set the global field and result in a reference count leak.
CPU1 CPU2 ---------------------------------------------------------------- attachtaskctxdata(.global=1) attachtaskctxdata(.global=0) cd1 = allocperfctxdata(); cd2 = allocperfctxdata(); // { .global = 0, .refcount = 1 };
trycmpxchg(); // success, // task->perfctxdata = cd2 trycmpxhg(); // fail; old = cd2 refcountincnotzero(&old->refcount); // success // old.refcount = 2 freeperfctxdata(cd1);
Then later detachglobalctxdata() will see the data but it's not marked as global, so it won't call detachtaskctxdata().
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
ubuntu/linux-hwe-7.0to a version that resolves this vulnerability.Fixed in 7.0.0-42.42~24.04.1 - Upgrade
Upgrade
ubuntu/linux-riscv-7.0to a version that resolves this vulnerability.Fixed in 7.0.0-42.42.1~24.04.1 - Upgrade
Upgrade
ubuntu/linuxto a version that resolves this vulnerability.Fixed in 7.0.0-42.42 - Upgrade
Upgrade
ubuntu/linux-awsto a version that resolves this vulnerability.Fixed in 7.0.0-1016.17 - Upgrade
Upgrade
ubuntu/linux-gcpto a version that resolves this vulnerability.Fixed in 7.0.0-1016.18 - Upgrade
Upgrade
ubuntu/linux-ibmto a version that resolves this vulnerability.Fixed in 7.0.0-1017.17 - Upgrade
Upgrade
ubuntu/linux-oem-7.0to a version that resolves this vulnerability.Fixed in 7.0.0-1017.17 - Upgrade
Upgrade
ubuntu/linux-oracleto a version that resolves this vulnerability.Fixed in 7.0.0-1015.16 - Upgrade
Upgrade
ubuntu/linux-riscvto a version that resolves this vulnerability.Fixed in 7.0.0-42.42.1
Event History
Frequently Asked Questions
What conditions are required for this issue to occur?
It requires a race between attaching global perf context data and attaching non-global perf context data for the same task. The race can leave the task's context data unmarked as global while retaining an extra reference.
What is the impact if the race is triggered?
The affected reference is not released later because detach_global_ctx_data() does not recognize the context data as global and therefore does not call detach_task_ctx_data(). This results in a reference-count leak.
How can I determine whether a system is affected?
The supplied data identifies the issue as resolved in Linux kernel stable commits 23250517cd475367653f1e99396967f54c6f1b7c, 5286d4eb5cd7e10d7d93c3cc596e18bc8ad80f72, and cca4980630b3c7a85f53cb43c6018184ce5d4e37. Compare the kernel source or applied stable patches against those commits.