CVE-2026-139214: Linux kernel perf races attaching and detaching per-task PMU data and uses a freed structure

ByLinuxtastic

December 3, 2026 #CVE, #Linux Kernel

Since 6.15 the perf subsystem can hang a block of PMU-specific data off a task, attached when an event that needs it is opened and detached when the last such event closes. The kernel CNA record describes the window between the two: “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.” The structure is RCU-protected, and the loop forgot to be an RCU reader. The kernel CNA and Red Hat score it 7.8 as a local flaw, Red Hat rates it Important. If a host runs a 6.15 or later kernel and lets unprivileged users open perf events, upgrade it to a kernel at or above 6.18.65 or 7.3.6 and reboot.

CVE-2026-139214 at a glance.

ComponentLinux kernel, the performance-events core: attach_task_ctx_data() in kernel/events/core.c
Affected versionsmainline 6.15 up to 7.4-rc1 (from commit 506e64e7, “perf: attach/detach PMU specific data”); 6.18.x below 6.18.65, 7.3.x below 7.3.6. Kernels before 6.15 have no per-task PMU data and are not affected
Fixed inmainline 7.4-rc1 (commit 64ea0e82, the one Debian cites) and stable 6.18.65, 7.3.6; three fix commits in the record. The fix takes rcu_read_lock() across the race window; three lines added to kernel/events/core.c
SeverityKernel CNA CVSS 3.1 7.8 (AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H), which NVD shows as its only metric; Red Hat Important, 7.8 on the same vector (score marked draft, CWE-825, expired pointer dereference); Ubuntu Medium, no score. A use after free in a core subsystem, from an unprivileged task
Exploited in the wildNot on the CISA KEV catalogue (2026.11.30). EPSS 0.00184 (8th percentile) on 1 December 2026
Who is exposedHosts on 6.15 or later where a task can open perf events that need PMU-specific context data, which on current hardware is a feature of particular PMUs rather than of every event; the record does not name the PMU, and this page does not guess. Red Hat’s statement: “By rapidly opening and closing performance event instances within an unprivileged task context, a race condition triggers a use-after-free flaw”, with privilege escalation or a crash as the outcome, and Red Hat marks RHEL 10 affected and RHEL 9 not. kernel.perf_event_paranoid decides which users can open events at all
PublishedCVE record 30 November 2026 (kernel CNA, updated 1 December); this page built 2 December 2026, last updated 2 December 2026

What it is

Some PMUs need state that follows a task rather than a CPU, and 6.15 added task->perf_ctx_data to carry it: a reference-counted, RCU-protected structure that attach_task_ctx_data() installs with a compare-and-exchange loop. The loop allocates a candidate, tries to swap it into the task’s pointer, and if the pointer already holds something it takes a reference to that instead. The record lays out the race in a two-column diagram. CPU 0’s exchange fails and loads the existing pointer cd1; CPU 1, running detach_task_ctx_data() for the last event that used it, drops the refcount to zero, swaps the pointer to NULL and schedules cd1 for freeing after an RCU grace period; CPU 0 then calls refcount_inc_not_zero() on cd1. Had CPU 0 been inside rcu_read_lock() the grace period could not have ended and cd1 would still be memory; it was not, so cd1 may already be freed and reallocated when CPU 0 touches it.

The structure is small and lives in a general slab cache, so what CPU 0 increments is a counter in whatever object now occupies that memory, and what it then uses as perf context data is that object too. The record calls this “UAF and further memory corruption when cd1 is reclaimed by another thread”, and both vendors score the full triple. The attacker is a task that opens and closes events quickly from two threads, which is what Red Hat’s statement describes, and perf_event_open() is available to unprivileged users for their own tasks on most distributions’ default perf_event_paranoid of 2 or lower; the question of which events need PMU-specific data is hardware-dependent, and the record does not answer it.

The fix on GitHub, by Lee Jia Jie and committed by Peter Zijlstra, adds three lines so that the retry loop runs inside rcu_read_lock() and rcu_read_unlock(), which is the rule for reading an RCU-protected pointer and is what every other reader of perf_ctx_data already did. The Fixes: tag names the 6.15 commit that added the mechanism. git.kernel.org and lore.kernel.org refuse automated readers, so the backports are described from the record and the mainline commit from its GitHub mirror.

Who is affected on Linux

Each row is what the distribution’s own security tracker said on 1 and 2 December 2026; the link in the row is the tracker page, which will be newer than this one. Only kernels from 6.15 are in range: Debian bookworm and trixie are not affected, and of the Red Hat family only RHEL 10 is.

DistributionStatusFixed package
AlpineNot consulted for this page—
Debianbookworm (6.1.192-3) and trixie (6.12.118-1) not affected (“vulnerable code not present”); fixed in forky and sid (7.3.6-1); no DSAunstable 7.3.6-1; bookworm and trixie not affected
UbuntuMedium, no Ubuntu CVSS yet; linux needs evaluation in every supported release from 14.04 to 26.10 (no version named); no USNnothing released on 1 December 2026
RHEL, Rocky, Alma, CentOS StreamImportant, 7.8 (bug 2587307, “Privilege escalation via use-after-free in perf subsystem”); RHEL 10 kernel affected, no errata yet; RHEL 6 to 9, kernel and kernel-rt, not affected; of the OpenShift images only CoreOS 10 affectednothing released on 2 December 2026
openSUSE/SLENot consulted: suse.com refused the automated reader on 2 December 2026 (client error, twice)—
Fedora, Arch; self-built kernelsNot consulted; upstream stable versions apply6.18.65 / 7.3.6 or later

How to check

Three questions, in order: is the kernel 6.15 or later and below the fixed version, can unprivileged users open perf events, and are there such users. The first settles it for every LTS kernel before 6.18; the second is the precondition.

# 1. the running kernel (6.15 or later is in range below 6.18.65 / 7.3.6)
uname -r

# 2. who can open perf events: 2 or lower lets any user profile their own tasks; 3 (Debian, Ubuntu) root only
sysctl kernel.perf_event_paranoid
# the per-task PMU data mechanism is present if this symbol is
grep -c perf_ctx_data /proc/kallsyms 2>/dev/null

# 3. the precondition: unprivileged, interactive or service users who can run code
who | awk '{print $1}' | sort -u
getent passwd | awk -F: '$3 >= 1000 && $7 !~ /nologin|false/ {print $1}'

A kernel below 6.15 is not in range, and one at or above the fixed stable version for its series is done. A host where perf_event_paranoid is 3, which Debian and Ubuntu kernels support and set by default, has removed the unprivileged attacker, because perf_event_open() then needs CAP_PERFMON; at 2 or lower any user can race the attach and detach on their own threads. There is no log line for an attempt; a successful one is a refcount warning or an oops in kernel/events/core.c.

How to fix it

Install the fixed kernel and reboot; perf is not a module. Debian forky and sid had the fix out on 2 December; Ubuntu and Red Hat had it pending, and the record lists no mitigation.

# Debian forky / sid (trixie and bookworm once a security update names this CVE)
apt update && apt install linux-image-amd64 && systemctl reboot       # or linux-image-arm64
# Ubuntu, RHEL family, SUSE: when the pending builds land
apt update && apt full-upgrade && systemctl reboot
dnf update kernel && systemctl reboot
zypper patch && systemctl reboot
uname -r
# Until then: keep perf_event_open away from unprivileged users
sysctl -w kernel.perf_event_paranoid=3      # honoured by Debian and Ubuntu kernels; mainline treats 3 as 2
printf 'kernel.perf_event_paranoid = 3\n' > /etc/sysctl.d/90-perf.conf
# and give the people who profile CAP_PERFMON instead
setcap cap_perfmon=ep /usr/bin/perf

Raising perf_event_paranoid to 3 is a real mitigation on kernels that honour that value, because the race needs perf_event_open(); on a mainline or Fedora kernel 3 behaves as 2 and unprivileged users can still open events on their own tasks, so there the only answer is the fixed kernel. What not to do: do not assume a 6.12 or 6.6 host is in range because the score is high; the mechanism arrived in 6.15 and Debian’s “vulnerable code not present” is correct. And do not read Red Hat’s RHEL 10 row as “RHEL 10 is on 6.15”: it means Red Hat backported the per-task data, which is why the kernel version alone is not the test on vendor kernels.

Sources

  • CVE-2026-139214 at CVE.org — the kernel CNA record: the commit message with the “runs without holding rcu_read_lock()” sentence and the two-CPU diagram, the git and version ranges, kernel/events/core.c (30 November 2026, updated 1 December)
  • Fix commits on git.kernel.org: 64ea0e82 (mainline, 7.4-rc1) and the backports 5d1869d0, b455bcb1; git.kernel.org refuses automated readers, so the mainline commit was read on GitHub: Lee Jia Jie, committed by Peter Zijlstra, Fixes: 506e64e7, core.c +3/−0
  • NVD entry — Received on 30 November 2026; shows the CNA’s 7.8 as a secondary metric, no NVD score, CWE or CPE on 2 December
  • Distribution trackers: Debian (bookworm and trixie not affected, forky and sid fixed in 7.3.6-1) · Ubuntu (Medium; needs evaluation in every release) · Red Hat (Important 7.8, RHEL 10 affected, 6 to 9 not; bug 2587307) · SUSE (not reachable on 2 December)
  • CISA KEV catalogue 2026.11.30, not listed · EPSS 0.00184 (percentile 0.084) on 1 December 2026

Related reading

This advisory page was assembled from the primary sources listed above on 2 December 2026 and is updated when they change. The facts are theirs; the checks and the ordering are ours. If a row in the distribution table is out of date, the tracker link in that row is the current word.