CVE-2024-38574

Source
https://nvd.nist.gov/vuln/detail/CVE-2024-38574
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2024-38574.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2024-38574
Downstream
Published
2024-06-19T13:35:39Z
Modified
2025-10-17T07:28:40.162109Z
Summary
libbpf: Prevent null-pointer dereference when prog to load has no BTF
Details

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

libbpf: Prevent null-pointer dereference when prog to load has no BTF

In bpfobjecloadprog(), there's no guarantee that obj->btf is non-NULL when passing it to btffd(), and this function does not perform any check before dereferencing its argument (as bpfobjectbtf_fd() used to do). As a consequence, we get segmentation fault errors in bpftool (for example) when trying to load programs that come without BTF information.

v2: Keep btffd() in the fix instead of reverting to bpfobjectbtffd().

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
df7c3f7d3a3ddab31ca8cfa9b86a8729ec43fd2e
Fixed
ef80b59acfa4dee4b5eaccb15572b69248831104
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
df7c3f7d3a3ddab31ca8cfa9b86a8729ec43fd2e
Fixed
1fd91360a75833b7110af9834ae26c977e1273e0
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
df7c3f7d3a3ddab31ca8cfa9b86a8729ec43fd2e
Fixed
9bf48fa19a4b1d186e08b20bf7e5de26a15644fb

Affected versions

v6.*

v6.7
v6.7-rc7
v6.7-rc8
v6.8
v6.8-rc1
v6.8-rc2
v6.8-rc3
v6.8-rc4
v6.8-rc5
v6.8-rc6
v6.8-rc7
v6.8.1
v6.8.10
v6.8.11
v6.8.2
v6.8.3
v6.8.4
v6.8.5
v6.8.6
v6.8.7
v6.8.8
v6.8.9
v6.9
v6.9-rc1
v6.9-rc2
v6.9-rc3
v6.9-rc4
v6.9-rc5
v6.9-rc6
v6.9-rc7
v6.9.1
v6.9.2

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
6.8.0
Fixed
6.8.12
Type
ECOSYSTEM
Events
Introduced
6.9.0
Fixed
6.9.3