Vulnerability · Published Mar 6, 2025 · Assigned by Linux

CVE-2024-58060bpf: Reject struct_ops registration that uses module ptr and the module btf_id is missing

High 7.8

In plain English

A high-severity use-after-free in Linux from Linux. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.2% (higher than 11% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS 3.1)7.8High
Exploit odds (30 days)0.2%top 89.5% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack toolingNoneno public tooling known

Official description

In the Linux kernel, the following vulnerability has been resolved: bpf: Reject struct_ops registration that uses module ptr and the module btf_id is missing There is a UAF report in the bpf_struct_ops when CONFIG_MODULES=n. In particular, the report is on tcp_congestion_ops that has a "struct module *owner" member. For struct_ops that has a "struct module *owner" member, it can be extended either by the regular kernel module or by the bpf_struct_ops. bpf_try_module_get() will be used to do the refcounting and different refcount is done based on the owner pointer. When CONFIG_MODULES=n, the btf_id of the "struct module" is missing: WARN: resolve_btfids: unresolved symbol module Thus, the bpf_try_module_get() cannot do the correct refcounting. Not all subsystem's struct_ops requires the "struct module *owner" member. e.g. the recent sched_ext_ops. This patch is to disable bpf_struct_ops registration if the struct_ops has the "struct module *" member and the "struct module" btf_id is missing. The btf_type_is_fwd() helper is moved to the btf.h header file for this test. This has happened since the beginning of bpf_struct_ops which has gone through many changes. The Fixes tag is set to a recent commit that this patch can apply cleanly. Considering CONFIG_MODULES=n is not common and the age of the issue, targeting for bpf-next also.

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
Debian:13linux6.12.13-1DEBIAN-CVE-2024-58060
Debian:14linux6.12.13-1DEBIAN-CVE-2024-58060
Ubuntu:22.04:LTSlinux-allwinner-5.19no fix listedUBUNTU-CVE-2024-58060
Ubuntu:22.04:LTSlinux-aws-5.19no fix listedUBUNTU-CVE-2024-58060
Ubuntu:22.04:LTSlinux-aws-6.2no fix listedUBUNTU-CVE-2024-58060
Ubuntu:22.04:LTSlinux-aws-6.5no fix listedUBUNTU-CVE-2024-58060
Ubuntu:22.04:LTSlinux-azure-5.19no fix listedUBUNTU-CVE-2024-58060
Ubuntu:24.04:LTSlinux-azure-6.116.11.0-1015.15~24.04.1UBUNTU-CVE-2024-58060
Ubuntu:22.04:LTSlinux-azure-6.2no fix listedUBUNTU-CVE-2024-58060
Ubuntu:22.04:LTSlinux-azure-6.5no fix listedUBUNTU-CVE-2024-58060
Ubuntu:22.04:LTSlinux-azure-fde-5.19no fix listedUBUNTU-CVE-2024-58060
Ubuntu:22.04:LTSlinux-azure-fde-6.2no fix listedUBUNTU-CVE-2024-58060
Ubuntu:22.04:LTSlinux-gcp-5.19no fix listedUBUNTU-CVE-2024-58060
Ubuntu:24.04:LTSlinux-gcp-6.116.11.0-1015.15~24.04.1UBUNTU-CVE-2024-58060
Ubuntu:22.04:LTSlinux-gcp-6.2no fix listedUBUNTU-CVE-2024-58060
Ubuntu:22.04:LTSlinux-gcp-6.5no fix listedUBUNTU-CVE-2024-58060
Ubuntu:22.04:LTSlinux-hwe-5.19no fix listedUBUNTU-CVE-2024-58060
Ubuntu:24.04:LTSlinux-hwe-6.116.11.0-26.26~24.04.1UBUNTU-CVE-2024-58060
Ubuntu:22.04:LTSlinux-hwe-6.2no fix listedUBUNTU-CVE-2024-58060
Ubuntu:22.04:LTSlinux-hwe-6.5no fix listedUBUNTU-CVE-2024-58060
Ubuntu:22.04:LTSlinux-intel-iot-realtimeno fix listedUBUNTU-CVE-2024-58060
Ubuntu:22.04:LTSlinux-lowlatency-hwe-5.19no fix listedUBUNTU-CVE-2024-58060
Ubuntu:24.04:LTSlinux-lowlatency-hwe-6.116.11.0-1014.15~24.04.1UBUNTU-CVE-2024-58060
Ubuntu:22.04:LTSlinux-lowlatency-hwe-6.2no fix listedUBUNTU-CVE-2024-58060
Ubuntu:22.04:LTSlinux-lowlatency-hwe-6.5no fix listedUBUNTU-CVE-2024-58060
Ubuntu:24.04:LTSlinux-nvidia-6.116.11.0-1010.10UBUNTU-CVE-2024-58060
Ubuntu:22.04:LTSlinux-nvidia-6.2no fix listedUBUNTU-CVE-2024-58060
Ubuntu:22.04:LTSlinux-nvidia-6.5no fix listedUBUNTU-CVE-2024-58060
Ubuntu:22.04:LTSlinux-oem-5.17no fix listedUBUNTU-CVE-2024-58060
Ubuntu:22.04:LTSlinux-oem-6.0no fix listedUBUNTU-CVE-2024-58060
Ubuntu:22.04:LTSlinux-oem-6.1no fix listedUBUNTU-CVE-2024-58060
Ubuntu:24.04:LTSlinux-oem-6.116.11.0-1022.22UBUNTU-CVE-2024-58060
Ubuntu:22.04:LTSlinux-oem-6.5no fix listedUBUNTU-CVE-2024-58060
Ubuntu:22.04:LTSlinux-oracle-6.5no fix listedUBUNTU-CVE-2024-58060
Ubuntu:24.04:LTSlinux-raspi-realtimeno fix listedUBUNTU-CVE-2024-58060
Ubuntu:22.04:LTSlinux-realtimeno fix listedUBUNTU-CVE-2024-58060
Ubuntu:22.04:LTSlinux-riscvno fix listedUBUNTU-CVE-2024-58060
Ubuntu:22.04:LTSlinux-riscv-5.19no fix listedUBUNTU-CVE-2024-58060
Ubuntu:22.04:LTSlinux-riscv-6.5no fix listedUBUNTU-CVE-2024-58060
Ubuntu:22.04:LTSlinux-starfive-5.19no fix listedUBUNTU-CVE-2024-58060
Ubuntu:22.04:LTSlinux-starfive-6.2no fix listedUBUNTU-CVE-2024-58060
Ubuntu:22.04:LTSlinux-starfive-6.5no fix listedUBUNTU-CVE-2024-58060

Affected products (as reported)

VendorProductVersions
Linux Linux 1611603537a4b88cec7993f32b70c03113801a46 – before b777b14c2a4a4e2322daf8e8ffd42d2b88831b171611603537a4b88cec7993f32b70c03113801a46 – before 2324fb4e92092837ee278fdd8d60c48ee1a619ce1611603537a4b88cec7993f32b70c03113801a46 – before 96ea081ed52bf077cad6d00153b6fba68e510767
Linux Linux 6.9

Weakness: CWE-416 · Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

References