5.5medium
bpf,perf: Fix invalid prog_array access in perf_event_detach_bpf_prog
- Severity
- 5.5medium CVSS:3.1 by CISA-ADP
- Exploit likelihood
- 0.22% (higher than 13% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- Linux
Description
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
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| Linux Linux | from 7a5c653ede645693422e43cccaa3e8f905d21c74 before 842e5af282453983586e2eae3c8eaf252de5f22f, from 21db2f35fa97e4a3447f2edeb7b2569a8bfdc83b before c2b6b47662d5f2dfce92e5ffbdcac8229f321d9d, from 0ee288e69d033850bc87abe0f9cc3ada24763d7f before dfb15ddf3b65e0df2129f9756d1b4fa78055cdb3, from 0ee288e69d033850bc87abe0f9cc3ada24763d7f before 978c4486cca5c7b9253d3ab98a88c8e769cb9bbd, b4007d5fe38625b8a1b8edc0f385d86527651238, 585674b9d0d80bd7f428b1f88be13cf6d5d6f739, from 6.1.115 before 6.1.121, from 6.6.59 before 6.6.67 and 3 more Not affected: before 6.12, from 6.1.121 up to 6.1.*, from 6.6.67 up to 6.6.*, from 6.12.6 up to 6.12.*, from 6.13 up to * | CVE List |
| linux linux_kernel | from 5.15.170 before 5.16, from 6.1.115 before 6.1.121, from 6.6.59 before 6.6.67, from 6.11.6 before 6.12.6, 6.13 | NVD |
All scores
| CISA-ADP | 5.5medium CVSS:3.1 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H |
| NVD | 5.5medium CVSS:3.1 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H |
Classification
SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.
What each source says
CVE List
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
NVD (es)
En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: bpf,perf: Se corrige el acceso no válido a prog_array en perf_event_detach_bpf_prog Syzbot informó [1] un fallo que ocurre en el siguiente escenario de seguimiento: - crear un evento perf de tracepoint con attr.inherit=1, adjuntarlo al proceso y establecerle el programa bpf - el proceso adjunto se bifurca -> chid crea un evento heredado el nuevo evento secundario comparte el programa bpf del padre y tp_event (de ahí prog_array) que es global para tracepoint - salir tanto del proceso como de su hijo -> liberar ambos eventos - la primera llamada perf_event_detach_bpf_prog liberará tp_event->prog_array y la segunda perf_event_detach_bpf_prog se bloqueará, porque tp_event->prog_array es NULL La corrección asegura que las comprobaciones perf_event_detach_bpf_prog prog_array es válido antes de intentar eliminar el programa bpf de él. [1] https://lore.kernel.org/bpf/Z1MR6dCIKajNS6nU@krava/T/#m91dbf0688221ec7a7fc95e896a7ef9ff93b0b8ad
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2024-56665 changed 2026-05-23 | CVE Terms of Use |
| NVD | CVE-2024-56665 changed 2026-06-17 | Public domain |