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 attach_perf_ctx_data() The attach_perf_ctx_data() can race on global and !global cases. The global case is protected by global_ctx_data_rwsem and shares a single reference count using perf_ctx_data.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 ---------------------------------------------------------------- attach_task_ctx_data(.global=1) attach_task_ctx_data(.global=0) cd1 = alloc_perf_ctx_data(); cd2 = alloc_perf_ctx_data(); // { .global = 0, .refcount = 1 }; try_cmpxchg(); // success, // task->perf_ctx_data = cd2 try_cmpxhg(); // fail; old = cd2 refcount_inc_not_zero(&old->refcount); // success // old.refcount = 2 free_perf_ctx_data(cd1); Then later detach_global_ctx_data() will see the data but it's not marked as global, so it won't call detach_task_ctx_data().
- Products
- Kernel
- Affected versions
- Not specified
- Fixed versions
- 6.18.55, 7.2.9
- CVEs
- CVE-2026-98552
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 3 Nov 2026, 14:21 UTC · Revision 1
Source evidence
perf/core: Fix a refcount leak in attach_perf_ctx_data()
core-osv · Original sourcePublished 18 Oct 2026, 15:18 UTC
In the Linux kernel, the following vulnerability has been resolved: perf/core: Fix a refcount leak in attach_perf_ctx_data() The attach_perf_ctx_data() can race on global and !global cases. The global case is protected by global_ctx_data_rwsem and shares a single reference count using perf_ctx_data.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 ---------------------------------------------------------------- attach_task_ctx_data(.global=1) attach_task_ctx_data(.global=0) cd1 = alloc_perf_ctx_data(); cd2 = alloc_perf_ctx_data(); // { .global = 0, .refcount = 1 }; try_cmpxchg(); // success, // task->perf_ctx_data = cd2 try_cmpxhg(); // fail; old = cd2 refcount_inc_not_zero(&old->refcount); // success // old.refcount = 2 free_perf_ctx_data(cd1); Then later detach_global_ctx_data() will see the data but it's not marked as global, so it won't call detach_task_ctx_data().
osv:CVE-2026-98552
Kernel
Fixed versions: 6.18.55, 7.2.9
Complete source record
{
"id": "2f53f02b0eec9c1caf86ba482d978dc905baec7b16cb3bc94402261162fb07b0",
"url": "https://osv.dev/vulnerability/CVE-2026-98552",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "perf/core: Fix a refcount leak in attach_perf_ctx_data()",
"summary": "In the Linux kernel, the following vulnerability has been resolved: perf/core: Fix a refcount leak in attach_perf_ctx_data() The attach_perf_ctx_data() can race on global and !global cases. The global case is protected by global_ctx_data_rwsem and shares a single reference count using perf_ctx_data.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 ---------------------------------------------------------------- attach_task_ctx_data(.global=1) attach_task_ctx_data(.global=0) cd1 = alloc_perf_ctx_data(); cd2 = alloc_perf_ctx_data(); // { .global = 0, .refcount = 1 }; try_cmpxchg(); // success, // task->perf_ctx_data = cd2 try_cmpxhg(); // fail; old = cd2 refcount_inc_not_zero(&old->refcount); // success // old.refcount = 2 free_perf_ctx_data(cd1); Then later detach_global_ctx_data() will see the data but it's not marked as global, so it won't call detach_task_ctx_data().",
"evidence": "osv:CVE-2026-98552",
"products": [
{
"name": {
"value": "Kernel",
"evidence": "/affected/1/package/name"
},
"prerequisites": [],
"fixed_versions": [
{
"value": "6.18.55",
"evidence": "/affected/1/ranges"
},
{
"value": "7.2.9",
"evidence": "/affected/1/ranges"
}
],
"affected_versions": []
}
],
"severity": "unknown",
"structured": {
"id": "CVE-2026-98552",
"aliases": [
"CVE-2026-98552"
],
"affected": [
{
"ranges": [
{
"repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
"type": "GIT",
"events": [
{
"introduced": "506e64e710ff9573fd2b86686528762b7901b5e4"
},
{
"fixed": "23250517cd475367653f1e99396967f54c6f1b7c"
},
{
"fixed": "5286d4eb5cd7e10d7d93c3cc596e18bc8ad80f72"
},
{
"fixed": "cca4980630b3c7a85f53cb43c6018184ce5d4e37"
}
]
}
],
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-98552.json"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "6.15.0"
},
{
"fixed": "6.18.55"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "6.19.0"
},
{
"fixed": "7.2.9"
}
]
}
],
"package": {
"name": "Kernel",
"ecosystem": "Linux"
},
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-98552.json"
}
}
],
"modified": "2026-10-28T02:30:29.244209400Z",
"provider": "osv",
"references": [
"https://git.kernel.org/stable/c/23250517cd475367653f1e99396967f54c6f1b7c",
"https://git.kernel.org/stable/c/5286d4eb5cd7e10d7d93c3cc596e18bc8ad80f72",
"https://git.kernel.org/stable/c/cca4980630b3c7a85f53cb43c6018184ce5d4e37",
"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/98xxx/CVE-2026-98552.json",
"https://nvd.nist.gov/vuln/detail/CVE-2026-98552",
"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"
],
"provider_metadata": {
"cna_assigner": "Linux",
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/98xxx/CVE-2026-98552.json"
}
},
"related_cves": [
{
"value": "CVE-2026-98552",
"evidence": "/id"
}
],
"security_relevant": true,
"severity_evidence": null
},
"source_id": "core-osv",
"document_id": 496312,
"published_at": "2026-10-18T15:18:19.81+00:00"
}