CVE-2026-139214: perf: Fix UAF in attach_task_ctx_data()

Published Nov 30, 2026
·
Updated

In the Linux kernel, the following vulnerability has been resolved:

perf: Fix UAF in attachtaskctxdata()

struct perfctxdata is RCU protected. In attachtaskctxdata(), the cmpxchg retry loop runs without holding rcureadlock(). If task->perfctxdata already holds a pointer (call it cd1), then trycmpxchg(&task->perfctxdata, &old, cd) fails and loads old = cd1. A concurrent thread running detachtaskctxdata() could free cd1 leading to UAF and further memory corruption when cd1 is reclaimed by another thread.

CPU 0: attachtaskctxdata() CPU 1: detachtaskctxdata() ----------------------------- ----------------------------- trycmpxchg(&task->perfctxdata, &old, cd2) -> fails; loads old = cd1

refcountdecandtest(&cd1->refcount) trycmpxchg(&task->perfctxdata, &cd1, NULL) perffreectxdatarcu(cd1) [ RCU grace period -> kfree(cd1) ]

refcountincnotzero(&old->refcount) -> UAF on freed cd1

Fix this by taking rcureadlock across the race window.

Affected Software

1 affected component
Linux Linux kernel

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Compensating control

    In Linux kernel perf's attach_task_ctx_data(), hold rcu_read_lock() across the cmpxchg retry-loop race window.

Event History

Nov 30, 2026
CVE Published
via MITRE·01:32 PM
Data Sourced
via MITRE·01:32 PM
Description

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203