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

Published Mar 6, 2025
·
Updated

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

bpf: Reject structops registration that uses module ptr and the module btfid is missing

There is a UAF report in the bpfstructops when CONFIGMODULES=n. In particular, the report is on tcpcongestionops that has a "struct module owner" member.

For structops that has a "struct module owner" member, it can be extended either by the regular kernel module or by the bpfstructops. bpftrymoduleget() will be used to do the refcounting and different refcount is done based on the owner pointer. When CONFIGMODULES=n, the btfid of the "struct module" is missing:

WARN: resolvebtfids: unresolved symbol module

Thus, the bpftrymoduleget() cannot do the correct refcounting.

Not all subsystem's structops requires the "struct module owner" member. e.g. the recent schedextops.

This patch is to disable bpfstructops registration if the structops has the "struct module " member and the "struct module" btfid is missing. The btftypeisfwd() helper is moved to the btf.h header file for this test.

This has happened since the beginning of bpfstructops which has gone through many changes. The Fixes tag is set to a recent commit that this patch can apply cleanly. Considering CONFIGMODULES=n is not common and the age of the issue, targeting for bpf-next also.

Affected Software

6 affected componentsFixes available
Linux Linux kernel
Linux Linux kernel>=6.9<6.12.13
Linux Linux kernel>=6.13<6.13.2
debian/linux<6.12.13-1
6.12.13-1
debian/linux<6.12.13-1
6.12.13-1
debian/linux
6.1.176-16.1.190-16.12.107-16.12.115-27.2.12-17.2.15-1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade debian/linux to a version that resolves this vulnerability.

    Fixed in 6.12.13-1
  2. Upgrade

    Upgrade debian/linux to a version that resolves this vulnerability.

    Fixed in 6.1.176-1Fixed in 6.1.190-1Fixed in 6.12.107-1Fixed in 6.12.115-2Fixed in 7.2.12-1Fixed in 7.2.15-1
  3. Configuration

    Disable bpf_struct_ops registration for struct_ops containing a struct module * member when the struct module BTF ID is unavailable, preventing incorrect bpf_try_module_get() refcounting.

    bpf_struct_ops struct_ops registration = disabled when the struct_ops has a struct module * member and the struct module BTF ID is missing

Event History

Mar 6, 2025
CVE Published
via MITRE·03:54 PM
Data Sourced
via MITRE·03:54 PM
DescriptionSeverity
Data Sourced
via OSV·04:15 PM
DescriptionSeverityAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2024-58060?

CVE-2024-58060 has been categorized based on its potential impact on system integrity and availability.

2

How do I fix CVE-2024-58060?

To resolve CVE-2024-58060, ensure your Linux kernel is updated to the latest version that includes the patch for this vulnerability.

3

What systems are affected by CVE-2024-58060?

CVE-2024-58060 affects systems running the Linux kernel where CONFIG_MODULES is not enabled.

4

What type of vulnerability is CVE-2024-58060?

CVE-2024-58060 is classified as a use-after-free (UAF) vulnerability found in the bpf_struct_ops.

5

Is CVE-2024-58060 a remote exploit vulnerability?

CVE-2024-58060 requires local access to exploit, as it involves operations within the Linux kernel.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203