CVE-2024-56702: bpf: Mark raw_tp arguments with PTR_MAYBE_NULL

Published Dec 28, 2024
·
Updated

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

bpf: Mark rawtp arguments with PTRMAYBENULL

Arguments to a raw tracepoint are tagged as trusted, which carries the semantics that the pointer will be non-NULL. However, in certain cases, a raw tracepoint argument may end up being NULL. More context about this issue is available in [0].

Thus, there is a discrepancy between the reality, that rawtp arguments can actually be NULL, and the verifier's knowledge, that they are never NULL, causing explicit NULL checks to be deleted, and accesses to such pointers potentially crashing the kernel.

To fix this, mark rawtp arguments as PTRMAYBENULL, and then special case the dereference and pointer arithmetic to permit it, and allow passing them into helpers/kfuncs; these exceptions are made for rawtp programs only. Ensure that we don't do this when refobjid > 0, as in that case this is an acquired object and doesn't need such adjustment.

The reason we do maskrawtptrustedreg logic is because other will recheck in places whether the register is a trustedreg, and then consider our register as untrusted when detecting the presence of the PTRMAYBENULL flag.

To allow safe dereference, we enable PROBEMEM marking when we see loads into trusted pointers with PTRMAYBENULL.

While trusted rawtp arguments can also be passed into helpers or kfuncs where such broken assumption may cause issues, a future patch set will tackle their case separately, as PTRTOBTFID (without PTRTRUSTED) can already be passed into helpers and causes similar problems. Thus, they are left alone for now.

It is possible that these checks also permit passing non-rawtp args that are trusted PTRTOBTFID with null marking. In such a case, allowing dereference when pointer is NULL expands allowed behavior, so won't regress existing programs, and the case of passing these into helpers is the same as above and will be dealt with later.

Also update the failure case in tpbtfnullable selftest to capture the new behavior, as the verifier will no longer cause an error when directly dereference a raw tracepoint argument marked as nullable.

[0]: https://lore.kernel.org/bpf/ZrCZS6nisraEqehw@jlelli-thinkpadt14gen4.remote.csb

Affected Software

126 affected componentsFixes available
Linux Linux kernel
Linux Linux kernel>=6.2<6.11.11
Linux Linux kernel>=6.12<6.12.2
debian/linux<6.12.3-1
6.12.3-1
debian/linux<6.12.3-1
6.12.3-1
debian/linux
6.1.176-16.1.190-16.12.107-16.12.115-27.2.12-17.2.15-1
ubuntu/linux-hwe-edge*
ubuntu/linux-aws-5.0*
ubuntu/linux-aws-5.3*
ubuntu/linux-azure*
ubuntu/linux-azure-5.3*
ubuntu/linux-azure-edge*
ubuntu/linux-gcp*
ubuntu/linux-gcp-5.3*
ubuntu/linux-gke-4.15*
ubuntu/linux-gke-5.4*
ubuntu/linux-gkeop-5.4*
ubuntu/linux-hwe*
ubuntu/linux-hwe-edge*
ubuntu/linux-oem*
ubuntu/linux-oracle-5.0*
ubuntu/linux-oracle-5.3*
ubuntu/linux-aws-5.11*
ubuntu/linux-aws-5.13*
ubuntu/linux-aws-5.8*
ubuntu/linux-azure-5.11*
ubuntu/linux-azure-5.13*
ubuntu/linux-azure-5.8*
ubuntu/linux-azure-fde*
ubuntu/linux-gcp-5.11*
ubuntu/linux-gcp-5.13*
ubuntu/linux-gcp-5.8*
ubuntu/linux-gke*
ubuntu/linux-gke-5.15*
ubuntu/linux-gkeop*
ubuntu/linux-gkeop-5.15*
ubuntu/linux-hwe-5.11*
ubuntu/linux-hwe-5.13*
ubuntu/linux-hwe-5.8*
ubuntu/linux-intel-5.13*
ubuntu/linux-oem-5.10*
ubuntu/linux-oem-5.13*
ubuntu/linux-oem-5.6*
ubuntu/linux-oracle-5.11*
ubuntu/linux-oracle-5.13*
ubuntu/linux-oracle-5.8*
ubuntu/linux-raspi2*
ubuntu/linux-riscv*
ubuntu/linux-riscv-5.11*
ubuntu/linux-riscv-5.8*
ubuntu/linux-allwinner-5.19*
ubuntu/linux-aws-5.19*
ubuntu/linux-aws-6.2*
ubuntu/linux-aws-6.5*
ubuntu/linux-aws-6.8*
ubuntu/linux-azure-5.19*
ubuntu/linux-azure-6.2*
ubuntu/linux-azure-6.5*
ubuntu/linux-azure-6.8*
ubuntu/linux-azure-fde-5.19*
ubuntu/linux-azure-fde-6.2*
ubuntu/linux-azure-fde-6.8*
ubuntu/linux-gcp-5.19*
ubuntu/linux-gcp-6.2*
ubuntu/linux-gcp-6.5*
ubuntu/linux-gcp-6.8<6.8.0-1074.82~22.04.1
6.8.0-1074.82~22.04.1
ubuntu/linux-hwe-5.19*
ubuntu/linux-hwe-6.2*
ubuntu/linux-hwe-6.5*
ubuntu/linux-ibm-6.8<6.8.0-1070.71~22.04.1
6.8.0-1070.71~22.04.1
ubuntu/linux-intel-iot-realtime*
ubuntu/linux-lowlatency-hwe-5.19*
ubuntu/linux-lowlatency-hwe-6.2*
ubuntu/linux-lowlatency-hwe-6.5*
ubuntu/linux-lowlatency-hwe-6.8*
ubuntu/linux-nvidia-6.2*
ubuntu/linux-nvidia-6.5*
ubuntu/linux-nvidia-6.8*
ubuntu/linux-oem-5.17*
ubuntu/linux-oem-6.0*
ubuntu/linux-oem-6.1*
ubuntu/linux-oem-6.5*
ubuntu/linux-oracle-6.5*
ubuntu/linux-oracle-6.8<6.8.0-1068.72~22.04.1
6.8.0-1068.72~22.04.1
ubuntu/linux-realtime*
ubuntu/linux-riscv*
ubuntu/linux-riscv-5.19*
ubuntu/linux-riscv-6.5*
ubuntu/linux-riscv-6.8*
ubuntu/linux-starfive-5.19*
ubuntu/linux-starfive-6.2*
ubuntu/linux-starfive-6.5*
ubuntu/linux-realtime-6.8*
ubuntu/linux<6.8.0-151.151
6.8.0-151.151
ubuntu/linux-aws<6.8.0-1070.76
6.8.0-1070.76
ubuntu/linux-azure*
ubuntu/linux-azure-6.11<6.11.0-1012.12~24.04.1
6.11.0-1012.12~24.04.1
ubuntu/linux-azure-fde*
ubuntu/linux-azure-nvidia*
ubuntu/linux-gcp<6.8.0-1074.82
6.8.0-1074.82
ubuntu/linux-gcp-6.11<6.11.0-1011.11~24.04.1
6.11.0-1011.11~24.04.1
ubuntu/linux-gke<6.8.0-1069.78
6.8.0-1069.78
ubuntu/linux-gkeop<6.8.0-1054.58
6.8.0-1054.58
ubuntu/linux-ibm<6.8.0-1070.71
6.8.0-1070.71
ubuntu/linux-intel*
ubuntu/linux-lowlatency*
ubuntu/linux-nvidia*
ubuntu/linux-nvidia-6.11<6.11.0-1007.7
6.11.0-1007.7
ubuntu/linux-nvidia-lowlatency*
ubuntu/linux-nvidia-tegra*
ubuntu/linux-oem-6.11<6.11.0-1015.15
6.11.0-1015.15
ubuntu/linux-oem-6.8*
ubuntu/linux-oracle<6.8.0-1068.72
6.8.0-1068.72
ubuntu/linux-raspi*
ubuntu/linux-raspi-realtime*
ubuntu/linux-realtime*
ubuntu/linux-riscv*
ubuntu/linux-vmware<6.8.0-1011.11
6.8.0-1011.11
ubuntu/linux-xilinx*
ubuntu/linux-bluefield*
ubuntu/linux-raspi-realtime*
ubuntu/linux-realtime*
ubuntu/linux-aws-fips<6.8.0-1070.76+fips1
6.8.0-1070.76+fips1
ubuntu/linux-azure-fips*
ubuntu/linux-fips*
ubuntu/linux-gcp-fips<6.8.0-1074.82+fips1
6.8.0-1074.82+fips1

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.3-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. Upgrade

    Upgrade ubuntu/linux-gcp-6.8 to a version that resolves this vulnerability.

    Fixed in 6.8.0-1074.82~22.04.1
  4. Upgrade

    Upgrade ubuntu/linux-ibm-6.8 to a version that resolves this vulnerability.

    Fixed in 6.8.0-1070.71~22.04.1
  5. Upgrade

    Upgrade ubuntu/linux-oracle-6.8 to a version that resolves this vulnerability.

    Fixed in 6.8.0-1068.72~22.04.1
  6. Upgrade

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

    Fixed in 6.8.0-151.151
  7. Upgrade

    Upgrade ubuntu/linux-aws to a version that resolves this vulnerability.

    Fixed in 6.8.0-1070.76
  8. Upgrade

    Upgrade ubuntu/linux-azure-6.11 to a version that resolves this vulnerability.

    Fixed in 6.11.0-1012.12~24.04.1
  9. Upgrade

    Upgrade ubuntu/linux-gcp to a version that resolves this vulnerability.

    Fixed in 6.8.0-1074.82
  10. Upgrade

    Upgrade ubuntu/linux-gcp-6.11 to a version that resolves this vulnerability.

    Fixed in 6.11.0-1011.11~24.04.1
  11. Upgrade

    Upgrade ubuntu/linux-gke to a version that resolves this vulnerability.

    Fixed in 6.8.0-1069.78
  12. Upgrade

    Upgrade ubuntu/linux-gkeop to a version that resolves this vulnerability.

    Fixed in 6.8.0-1054.58
  13. Upgrade

    Upgrade ubuntu/linux-ibm to a version that resolves this vulnerability.

    Fixed in 6.8.0-1070.71
  14. Upgrade

    Upgrade ubuntu/linux-nvidia-6.11 to a version that resolves this vulnerability.

    Fixed in 6.11.0-1007.7
  15. Upgrade

    Upgrade ubuntu/linux-oem-6.11 to a version that resolves this vulnerability.

    Fixed in 6.11.0-1015.15
  16. Upgrade

    Upgrade ubuntu/linux-oracle to a version that resolves this vulnerability.

    Fixed in 6.8.0-1068.72
  17. Upgrade

    Upgrade ubuntu/linux-vmware to a version that resolves this vulnerability.

    Fixed in 6.8.0-1011.11
  18. Upgrade

    Upgrade ubuntu/linux-aws-fips to a version that resolves this vulnerability.

    Fixed in 6.8.0-1070.76+fips1
  19. Upgrade

    Upgrade ubuntu/linux-gcp-fips to a version that resolves this vulnerability.

    Fixed in 6.8.0-1074.82+fips1
  20. Compensating control

    In the BPF verifier, mark raw tracepoint arguments with PTR_MAYBE_NULL; special-case raw tracepoint programs to permit dereference, pointer arithmetic, and passing these arguments to helpers/kfuncs, while avoiding the adjustment when ref_obj_id > 0 because the register is an acquired object. Enable PROBE_MEM marking for loads into trusted pointers carrying PTR_MAYBE_NULL, and retain the mask_raw_tp_trusted_reg handling so trusted-register checks recognize the nullable flag.

Event History

Dec 28, 2024
CVE Published
via MITRE·09:46 AM
Data Sourced
via MITRE·09:46 AM
Description
Data Sourced
via OSV·10:15 AM
DescriptionSeverityAffected Software
Event
via OSV·10:15 AM
Data Sourced
via NVD·10:15 AM
Description
Feb 3, 2025
Data Sourced
via NVD·03:14 PM
RemedySeverityWeaknessAffected Software
Oct 1, 2025
Updated
via NVD·08:17 PM
SeverityWeaknessAffected Software
Oct 21, 2026
Updated
via NVD·01:17 PM
SeverityWeaknessAffected Software
Nov 11, 2026
Updated
via OSV·09:38 AM
Affected Software
Nov 12, 2026
Updated
via OSV·05:24 PM
Affected Software
Nov 20, 2026
Updated
via OSV·06:33 AM
Affected Software

Frequently Asked Questions

1

What is the severity of CVE-2024-56702?

The severity of CVE-2024-56702 is categorized as a moderate vulnerability affecting the Linux kernel.

2

How do I fix CVE-2024-56702?

To fix CVE-2024-56702, update your Linux kernel to a version that includes the security patches addressing this vulnerability.

3

What versions of the Linux kernel are affected by CVE-2024-56702?

CVE-2024-56702 affects Linux kernel versions from 6.2 up to 6.11.11 and versions starting from 6.12 to 6.12.2.

4

What causes CVE-2024-56702 in the Linux kernel?

CVE-2024-56702 is caused by improper handling of raw tracepoint arguments which are incorrectly tagged as non-NULL trusted pointers.

5

Who can be impacted by CVE-2024-56702?

Users running affected versions of the Linux kernel may be exposed to potential security risks due to CVE-2024-56702.

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