CVE-2024-56665

Source
https://cve.org/CVERecord?id=CVE-2024-56665
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2024-56665.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2024-56665
Downstream
Related
Published
2024-12-27T15:06:27.205Z
Modified
2026-03-20T12:40:58.002091Z
Severity
  • 5.5 (Medium) CVSS_V3 - CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H CVSS Calculator
Summary
bpf,perf: Fix invalid prog_array access in perf_event_detach_bpf_prog
Details

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

bpf,perf: Fix invalid progarray access in perfeventdetachbpf_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 tpevent (hence progarray) which is global for tracepoint

  • exit both process and its child -> release both events

  • first perfeventdetachbpfprog call will release tpevent->progarray and second perfeventdetachbpfprog will crash, because tpevent->progarray is NULL

The fix makes sure the perfeventdetachbpfprog 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

Database specific
{
    "cna_assigner": "Linux",
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/56xxx/CVE-2024-56665.json"
}
References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
7a5c653ede645693422e43cccaa3e8f905d21c74
Fixed
842e5af282453983586e2eae3c8eaf252de5f22f
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
21db2f35fa97e4a3447f2edeb7b2569a8bfdc83b
Fixed
c2b6b47662d5f2dfce92e5ffbdcac8229f321d9d
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
0ee288e69d033850bc87abe0f9cc3ada24763d7f
Fixed
dfb15ddf3b65e0df2129f9756d1b4fa78055cdb3
Fixed
978c4486cca5c7b9253d3ab98a88c8e769cb9bbd
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
0 Unknown introduced commit / All previous commits are affected
Last affected
b4007d5fe38625b8a1b8edc0f385d86527651238
Last affected
585674b9d0d80bd7f428b1f88be13cf6d5d6f739

Database specific

source
"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2024-56665.json"