CVE-2026-139214
published high CVSS 3.1 · 7.8perf: Fix UAF in attach_task_ctx_data()
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| Linux | — | Linux506e64e710ff9573fd2b86686528762b7901b5e4 to < 5d1869d012b475e9165c201a5cc71ad1ac92115a · 506e64e710ff9573fd2b86686528762b7901b5e4 to < b455bcb13502696e588c7a0e60a196851fb87474 · 506e64e710ff9573fd2b86686528762b7901b5e4 to < 64ea0e8226ed98d14e0231af1beae10c3d5c043a · Other versions: unaffected | Affected | Not stated | Linux |
| Linux | — | Linux6.15 (affected) · 0 to < 6.15 (unaffected · semver) · 6.18.65 through 6.18.* (unaffected · semver) · 7.3.6 through 7.3.* (unaffected · semver) · 7.4-rc1 and later (unaffected · original_commit_for_fix) · Other versions: affected | Version-specific | Not stated | Linux |
| Amazon Linux | AL2 | Release evaluation | Not Affected | Not required | Amazon Linux assessment |
| Amazon Linux | AL2023 | Release evaluation | Not Affected; Pending Fix | Not stated | Amazon Linux assessment |
Description
In the Linux kernel, the following vulnerability has been resolved: perf: Fix UAF in attach_task_ctx_data() struct perf_ctx_data is RCU protected. In attach_task_ctx_data(), the cmpxchg retry loop runs without holding rcu_read_lock(). If task->perf_ctx_data already holds a pointer (call it `cd1`), then try_cmpxchg(&task->perf_ctx_data, &old, cd) fails and loads old = cd1. A concurrent thread running detach_task_ctx_data() could free cd1 leading to UAF and further memory corruption when cd1 is reclaimed by another thread. CPU 0: attach_task_ctx_data() CPU 1: detach_task_ctx_data() ----------------------------- ----------------------------- try_cmpxchg(&task->perf_ctx_data, &old, cd2) -> fails; loads old = cd1 refcount_dec_and_test(&cd1->refcount) try_cmpxchg(&task->perf_ctx_data, &cd1, NULL) perf_free_ctx_data_rcu(cd1) [ RCU grace period -> kfree(cd1) ] refcount_inc_not_zero(&old->refcount) -> UAF on freed cd1 Fix this by taking rcu_read_lock across the race window.
Related advisories
Vendor advisories explicitly linked to this CVE.
No linked advisories were found for this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 3.1
- Base score
- 7.8 / 10
- Severity
- high
- Provider
- Linux · cna
- Vector string
- CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- Scenarios
- en: AV:L - The freed perf_ctx_data is dereferenced in attach_task_ctx_data(), reached locally via perf_event_open() → perf_event_alloc() → attach_perf_ctx_data() for an x86 LBR call-stack event (PERF_ATTACH_TASK_DATA set in x86_pmu_hw_config). The free comes from close() → __free_event() → detach_task_ctx_data(); no remote data is involved. AC:L - The attacker controls both sides on their own thread: one thread opens LBR call-stack events while another closes the event holding the last ref. The stalled reader is the attacker's own syscall thread, whose scheduling they control (SCHED_IDLE, same-CPU hog), and failed attempts are harmless and retryable. PR:L - At the default perf_event_paranoid=2, an unprivileged user may open a per-task event on their own thread with exclude_kernel=1 and branch_sample_type USER|CALL_STACK. PERF_SAMPLE_BRANCH_PERM_PLM is unset, so perf_allow_kernel() is never called and no capability is needed. Only the cpu-wide (global) path needs CAP_PERFMON. UI:N - The attacker triggers both the attach and the detach with their own perf_event_open() and close() calls on their own task; no other user or administrator action is required. S:U - Corrupting a kernel heap object yields kernel-level compromise within the same kernel security authority; no hypervisor, IOMMU or other boundary is crossed. C:H - This is a use-after-free of a kmalloc-64 struct perf_ctx_data, a general cache the attacker can refill with sprayed objects. The resulting corruption of a reclaimed object can be built into kernel memory disclosure. I:H - refcount_inc_not_zero(&old->refcount) atomically increments the 32-bit field at offset 16 of whatever object now occupies the freed slot, and saturates it on overflow. This is a repeatable write primitive into an attacker-chosen victim object, usable for privilege escalation. A:H - Incrementing a field in a reallocated object corrupts unrelated kernel state, which can cause an oops, a refcount_t saturation WARN (a panic under panic_on_warn), or a crash in the victim object's user.
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| Linux | Linux | 506e64e710ff9573fd2b86686528762b7901b5e4 to < 5d1869d012b475e9165c201a5cc71ad1ac92115a (affected · git)506e64e710ff9573fd2b86686528762b7901b5e4 to < b455bcb13502696e588c7a0e60a196851fb87474 (affected · git)506e64e710ff9573fd2b86686528762b7901b5e4 to < 64ea0e8226ed98d14e0231af1beae10c3d5c043a (affected · git)Default: unaffected | Linux · cna |
| Linux | Linux | 6.15 (affected)0 to < 6.15 (unaffected · semver)6.18.65 through 6.18.* (unaffected · semver)7.3.6 through 7.3.* (unaffected · semver)7.4-rc1 and later (unaffected · original_commit_for_fix)Default: affected | Linux · cna |
Weaknesses
0No weakness assertions.
References
3Provider assertions
1Linux · cna
perf: Fix UAF in attach_task_ctx_data()
Provenance
- Schema
- 5.2
- Searchable
- yes
- Content hash
- 93753cbf1e6b793b644cc1cdde85d5b1aec6ff3b1e9841d0732d1fa1e6c8a4ae
- Ingested
- 01 Dec 2026, 05:47:22 UTC
- Source record
- Official CVE record