{"id":"CVE-2026-139214","aliases":["CVE-2026-139214"],"related":[],"kind":"vulnerability","state":"published","title":"perf: Fix UAF in attach_task_ctx_data()","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nperf: Fix UAF in attach_task_ctx_data()\n\nstruct perf_ctx_data is RCU protected. In attach_task_ctx_data(),\nthe cmpxchg retry loop runs without holding rcu_read_lock(). If\ntask->perf_ctx_data already holds a pointer (call it `cd1`), then\ntry_cmpxchg(&task->perf_ctx_data, &old, cd) fails and loads old = cd1.\nA concurrent thread running detach_task_ctx_data() could free cd1\nleading to UAF and further memory corruption when cd1 is reclaimed by\nanother thread.\n\n  CPU 0: attach_task_ctx_data()     CPU 1: detach_task_ctx_data()\n  -----------------------------     -----------------------------\n  try_cmpxchg(&task->perf_ctx_data,\n              &old, cd2)\n    -> fails; loads old = cd1\n\n                                    refcount_dec_and_test(&cd1->refcount)\n                                    try_cmpxchg(&task->perf_ctx_data,\n                                                &cd1, NULL)\n                                    perf_free_ctx_data_rcu(cd1)\n                                    [ RCU grace period -> kfree(cd1) ]\n\n  refcount_inc_not_zero(&old->refcount)\n    -> UAF on freed cd1\n\nFix this by taking rcu_read_lock across the race window.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nperf: Fix UAF in attach_task_ctx_data()\n\nstruct perf_ctx_data is RCU protected. In attach_task_ctx_data(),\nthe cmpxchg retry loop runs without holding rcu_read_lock(). If\ntask->perf_ctx_data already holds a pointer (call it `cd1`), then\ntry_cmpxchg(&task->perf_ctx_data, &old, cd) fails and loads old = cd1.\nA concurrent thread running detach_task_ctx_data() could free cd1\nleading to UAF and further memory corruption when cd1 is reclaimed by\nanother thread.\n\n  CPU 0: attach_task_ctx_data()     CPU 1: detach_task_ctx_data()\n  -----------------------------     -----------------------------\n  try_cmpxchg(&task->perf_ctx_data,\n              &old, cd2)\n    -> fails; loads old = cd1\n\n                                    refcount_dec_and_test(&cd1->refcount)\n                                    try_cmpxchg(&task->perf_ctx_data,\n                                                &cd1, NULL)\n                                    perf_free_ctx_data_rcu(cd1)\n                                    [ RCU grace period -> kfree(cd1) ]\n\n  refcount_inc_not_zero(&old->refcount)\n    -> UAF on freed cd1\n\nFix this by taking rcu_read_lock across the race window.","source":"cvelist"}],"published":"2026-11-30T13:32:38.695Z","modified":"2026-12-01T06:17:39.047Z","severity":{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"},"severities":[{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"}],"cwes":[],"affected":[{"ranges":[{"type":"git","introduced":"506e64e710ff9573fd2b86686528762b7901b5e4","fixed":"5d1869d012b475e9165c201a5cc71ad1ac92115a","status":"affected"},{"type":"git","introduced":"506e64e710ff9573fd2b86686528762b7901b5e4","fixed":"b455bcb13502696e588c7a0e60a196851fb87474","status":"affected"},{"type":"git","introduced":"506e64e710ff9573fd2b86686528762b7901b5e4","fixed":"64ea0e8226ed98d14e0231af1beae10c3d5c043a","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"6.15","status":"affected"},{"type":"semver","introduced":"0","fixed":"6.15","status":"unaffected"},{"type":"semver","introduced":"6.18.65","lastAffected":"6.18.*","status":"unaffected"},{"type":"semver","introduced":"7.3.6","lastAffected":"7.3.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"7.4-rc1","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"}],"references":[{"url":"https://git.kernel.org/stable/c/5d1869d012b475e9165c201a5cc71ad1ac92115a","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/b455bcb13502696e588c7a0e60a196851fb87474","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/64ea0e8226ed98d14e0231af1beae10c3d5c043a","tags":[],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-139214","url":"https://www.cve.org/CVERecord?id=CVE-2026-139214","licence":"CVE Terms of Use","modified":"2026-12-01T05:41:49.107Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-139214","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-139214","licence":"Public domain","modified":"2026-12-01T06:17:39.047Z"}],"updatedAt":"2026-12-01T06:32:24.092Z","epss":{"score":0.00184,"percentile":0.08379,"date":"2026-12-01T12:00:22.000Z"}}