CVE-2024-56665

Source
https://cve.org/CVERecord?id=CVE-2024-56665
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2024-56665.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2024-56665
Downstream
AZL (2)
BELL (1)
DEBIAN (1)
MGASA (2)
OESA (2)
ROOT (1)
SUSE (8)
UBUNTU (1)
Related
Published
2024-12-27T15:06:27Z
Modified
2026-10-20T11:05:01Z
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 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

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
6.1.115
Fixed
6.1.121
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
6.6.59
Fixed
6.6.67
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
5.15.170
Fixed
5.16
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
6.11.6
Fixed
6.12
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
b4007d5fe38625b8a1b8edc0f385d86527651238
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
585674b9d0d80bd7f428b1f88be13cf6d5d6f739

Affected versions

v5.*
v5.15.170
v5.15.171
v5.15.172
v5.15.173
v5.15.174
v5.15.175
v5.15.176
v5.15.177
v5.15.178
v5.15.179
v5.15.180
v5.15.181
v5.15.182
v5.15.183
v5.15.184
v5.15.185
v5.15.186
v5.15.187
v5.15.188
v5.15.189
v5.15.190
v5.15.191
v5.15.192
v5.15.193
v5.15.194
v5.15.195
v5.15.196
v5.15.197
v5.15.198
v5.15.199
v5.15.200
v5.15.201
v5.15.202
v5.15.203
v5.15.204
v5.15.205
v5.15.206
v5.15.207
v5.15.208
v5.15.209
v5.15.210
v5.15.211
v5.15.212
v5.15.213
v5.15.214
v5.15.215
v5.15.216
v5.15.217
v5.15.218
v5.15.219
v5.15.220
v5.15.221
v5.15.222
v5.15.223
v6.*
v6.1.115
v6.1.116
v6.1.117
v6.1.118
v6.1.119
v6.1.120
v6.11.10
v6.11.11
v6.11.6
v6.11.7
v6.11.8
v6.11.9
v6.6.59
v6.6.60
v6.6.61
v6.6.62
v6.6.63
v6.6.64
v6.6.65
v6.6.66

Database specific

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

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0 Unknown introduced version / All previous versions are affected
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

Database specific

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