CVE-2024-50161 Information
Description
In the Linux kernel the following vulnerability has been resolved:
bpf: Check the remaining info_cnt before repeating btf fields
When trying to repeat the btf fields for array of nested struct it doesn’t check the remaining info_cnt. The following splat will be reported when the value of ret nelems is greater than BTF_FIELDS_MAX:
————[ cut here ]————
UBSAN: array-index-out-of-bounds in ../kernel/bpf/btf.c:3951:49
index 11 is out of range for type ‘btf_field_info [11]’
CPU: 6 UID: 0 PID: 411 Comm: test_progs …… 6.11.0-rc4+ 1
Tainted: [O]=OOT_MODULE
Hardware name: QEMU Standard PC (i440FX + PIIX 1996) BIOS …
Call Trace:
Fix it by checking the remaining info_cnt in btf_repeat_fields() before repeating the btf fields.
Reference
https://git.kernel.org/stable/c/6f957d972feee9b385ea3ae6530310a84e55ba71 https://git.kernel.org/stable/c/797d73ee232dd1833dec4824bc53a22032e97c1c
Share on: