CVE-2024-56665

Severity CVSS v4.0:
Pending analysis
Type:
Unavailable / Other
Publication date:
27/12/2024
Last modified:
06/01/2025

Description

In the Linux kernel, the following vulnerability has been resolved:<br /> <br /> bpf,perf: Fix invalid prog_array access in perf_event_detach_bpf_prog<br /> <br /> Syzbot reported [1] crash that happens for following tracing scenario:<br /> <br /> - create tracepoint perf event with attr.inherit=1, attach it to the<br /> process and set bpf program to it<br /> - attached process forks -&gt; chid creates inherited event<br /> <br /> the new child event shares the parent&amp;#39;s bpf program and tp_event<br /> (hence prog_array) which is global for tracepoint<br /> <br /> - exit both process and its child -&gt; release both events<br /> - first perf_event_detach_bpf_prog call will release tp_event-&gt;prog_array<br /> and second perf_event_detach_bpf_prog will crash, because<br /> tp_event-&gt;prog_array is NULL<br /> <br /> The fix makes sure the perf_event_detach_bpf_prog checks prog_array<br /> is valid before it tries to remove the bpf program from it.<br /> <br /> [1] https://lore.kernel.org/bpf/Z1MR6dCIKajNS6nU@krava/T/#m91dbf0688221ec7a7fc95e896a7ef9ff93b0b8ad

Vulnerable products and versions

CPE From Up to
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 5.15.170 (including) 5.16 (excluding)
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 6.1.115 (including) 6.1.121 (excluding)
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 6.6.59 (including) 6.6.67 (excluding)
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 6.11.6 (including) 6.12.6 (excluding)
cpe:2.3:o:linux:linux_kernel:6.13:rc1:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:6.13:rc2:*:*:*:*:*:*