bpf,perf: Fix invalid prog_array access in perf_event_detach_bpf_prog
In the Linux kernel, the following vulnerability has been resolved: bpf,perf: Fix invalid prog_array access in perf_event_detach_bpf_prog Syzbot reported [1] crash that happens for following tracing scenario: - create tracepoint perf event with attr.inherit=1, attach it to the process and set bpf program to it - attached process forks -> chid creates inherited event the new child event shares the parent's bpf program and tp_event (hence prog_array) which is global for tracepoint - exit both process and its child -> release both events - first perf_event_detach_bpf_prog call will release tp_event->prog_array and second perf_event_detach_bpf_prog will crash, because tp_event->prog_array is NULL The fix makes sure the perf_event_detach_bpf_prog checks prog_array is valid before it tries to remove the bpf program from it. [1] https://lore.kernel.org/bpf/Z1MR6dCIKajNS6nU@krava/T/#m91dbf0688221ec7a7fc95e896a7ef9ff93b0b8ad
- Products
- Kernel
- Affected versions
- Not specified
- Fixed versions
- 6.1.121, 6.12.6, 6.6.67
- CVEs
- CVE-2024-56665
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 4 Nov 2026, 21:00 UTC · Revision 1
Source evidence
bpf,perf: Fix invalid prog_array access in perf_event_detach_bpf_prog
core-osv · Original sourcePublished 27 Dec 2024, 15:06 UTC
In the Linux kernel, the following vulnerability has been resolved: bpf,perf: Fix invalid prog_array access in perf_event_detach_bpf_prog Syzbot reported [1] crash that happens for following tracing scenario: - create tracepoint perf event with attr.inherit=1, attach it to the process and set bpf program to it - attached process forks -> chid creates inherited event the new child event shares the parent's bpf program and tp_event (hence prog_array) which is global for tracepoint - exit both process and its child -> release both events - first perf_event_detach_bpf_prog call will release tp_event->prog_array and second perf_event_detach_bpf_prog will crash, because tp_event->prog_array is NULL The fix makes sure the perf_event_detach_bpf_prog checks prog_array is valid before it tries to remove the bpf program from it. [1] https://lore.kernel.org/bpf/Z1MR6dCIKajNS6nU@krava/T/#m91dbf0688221ec7a7fc95e896a7ef9ff93b0b8ad
osv:CVE-2024-56665
Kernel
Fixed versions: 6.1.121, 6.6.67, 6.12.6
Complete source record
{
"id": "ed8e1206f88efad2165dade269993e9e64ec29521741e8e343e54761cdf496a8",
"url": "https://osv.dev/vulnerability/CVE-2024-56665",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "bpf,perf: Fix invalid prog_array access in perf_event_detach_bpf_prog",
"summary": "In the Linux kernel, the following vulnerability has been resolved: bpf,perf: Fix invalid prog_array access in perf_event_detach_bpf_prog Syzbot reported [1] crash that happens for following tracing scenario: - create tracepoint perf event with attr.inherit=1, attach it to the process and set bpf program to it - attached process forks -> chid creates inherited event the new child event shares the parent's bpf program and tp_event (hence prog_array) which is global for tracepoint - exit both process and its child -> release both events - first perf_event_detach_bpf_prog call will release tp_event->prog_array and second perf_event_detach_bpf_prog will crash, because tp_event->prog_array is NULL The fix makes sure the perf_event_detach_bpf_prog checks prog_array is valid before it tries to remove the bpf program from it. [1] https://lore.kernel.org/bpf/Z1MR6dCIKajNS6nU@krava/T/#m91dbf0688221ec7a7fc95e896a7ef9ff93b0b8ad",
"evidence": "osv:CVE-2024-56665",
"products": [
{
"name": {
"value": "Kernel",
"evidence": "/affected/1/package/name"
},
"prerequisites": [],
"fixed_versions": [
{
"value": "6.1.121",
"evidence": "/affected/1/ranges"
},
{
"value": "6.6.67",
"evidence": "/affected/1/ranges"
},
{
"value": "6.12.6",
"evidence": "/affected/1/ranges"
}
],
"affected_versions": []
}
],
"severity": "medium",
"structured": {
"id": "CVE-2024-56665",
"aliases": [
"CVE-2024-56665"
],
"metrics": [
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H"
}
],
"affected": [
{
"ranges": [
{
"repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
"type": "GIT",
"events": [
{
"introduced": "7a5c653ede645693422e43cccaa3e8f905d21c74"
},
{
"fixed": "842e5af282453983586e2eae3c8eaf252de5f22f"
}
]
},
{
"repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
"type": "GIT",
"events": [
{
"introduced": "21db2f35fa97e4a3447f2edeb7b2569a8bfdc83b"
},
{
"fixed": "c2b6b47662d5f2dfce92e5ffbdcac8229f321d9d"
}
]
},
{
"repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
"type": "GIT",
"events": [
{
"introduced": "0ee288e69d033850bc87abe0f9cc3ada24763d7f"
},
{
"fixed": "dfb15ddf3b65e0df2129f9756d1b4fa78055cdb3"
},
{
"fixed": "978c4486cca5c7b9253d3ab98a88c8e769cb9bbd"
}
]
},
{
"repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
"type": "GIT",
"events": [
{
"introduced": "6.1.115"
},
{
"fixed": "6.1.121"
}
]
},
{
"repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
"type": "GIT",
"events": [
{
"introduced": "6.6.59"
},
{
"fixed": "6.6.67"
}
]
},
{
"repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
"type": "GIT",
"events": [
{
"introduced": "5.15.170"
},
{
"fixed": "5.16"
}
]
},
{
"repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
"type": "GIT",
"events": [
{
"introduced": "6.11.6"
},
{
"fixed": "6.12"
}
]
},
{
"repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
"type": "GIT",
"events": [
{
"introduced": "b4007d5fe38625b8a1b8edc0f385d86527651238"
}
]
},
{
"repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
"type": "GIT",
"events": [
{
"introduced": "585674b9d0d80bd7f428b1f88be13cf6d5d6f739"
}
]
}
],
"versions": [
"v6.1.120",
"v6.1.119",
"v6.1.118",
"v6.1.117",
"v6.1.116",
"v6.1.115",
"v6.6.66",
"v6.6.65",
"v6.6.64",
"v6.6.63",
"v6.6.62",
"v6.6.61",
"v6.6.60",
"v6.6.59",
"v5.15.223",
"v5.15.222",
"v5.15.221",
"v5.15.220",
"v5.15.219",
"v5.15.218",
"v5.15.217",
"v5.15.216",
"v5.15.215",
"v5.15.214",
"v5.15.213",
"v5.15.212",
"v5.15.211",
"v5.15.210",
"v5.15.209",
"v5.15.208",
"v5.15.207",
"v5.15.206",
"v5.15.205",
"v5.15.204",
"v5.15.203",
"v5.15.202",
"v5.15.201",
"v5.15.200",
"v5.15.199",
"v5.15.198",
"v5.15.197",
"v5.15.196",
"v5.15.195",
"v5.15.194",
"v5.15.193",
"v5.15.192",
"v5.15.191",
"v5.15.190",
"v5.15.189",
"v5.15.188",
"v5.15.187",
"v5.15.186",
"v5.15.185",
"v5.15.184",
"v5.15.183",
"v5.15.182",
"v5.15.181",
"v5.15.180",
"v5.15.179",
"v5.15.178",
"v5.15.177",
"v5.15.176",
"v5.15.175",
"v5.15.174",
"v5.15.173",
"v5.15.172",
"v5.15.171",
"v5.15.170",
"v6.11.11",
"v6.11.10",
"v6.11.9",
"v6.11.8",
"v6.11.7",
"v6.11.6"
],
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2024-56665.json"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
},
{
"fixed": "6.1.121"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "6.2.0"
},
{
"fixed": "6.6.67"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "6.7.0"
},
{
"fixed": "6.12.6"
}
]
}
],
"package": {
"name": "Kernel",
"ecosystem": "Linux"
},
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2024-56665.json"
}
}
],
"modified": "2026-10-28T02:30:39.433902177Z",
"provider": "osv",
"references": [
"https://git.kernel.org/stable/c/842e5af282453983586e2eae3c8eaf252de5f22f",
"https://git.kernel.org/stable/c/978c4486cca5c7b9253d3ab98a88c8e769cb9bbd",
"https://git.kernel.org/stable/c/c2b6b47662d5f2dfce92e5ffbdcac8229f321d9d",
"https://git.kernel.org/stable/c/dfb15ddf3b65e0df2129f9756d1b4fa78055cdb3",
"https://lists.debian.org/debian-lts-announce/2025/03/msg00001.html",
"https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/56xxx/CVE-2024-56665.json",
"https://nvd.nist.gov/vuln/detail/CVE-2024-56665",
"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/2024/56xxx/CVE-2024-56665.json"
}
},
"related_cves": [
{
"value": "CVE-2024-56665",
"evidence": "/id"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 506974,
"published_at": "2024-12-27T15:06:27.205+00:00"
}