Vulnerability · Published Mar 6, 2025 · Assigned by Linux
CVE-2024-58070bpf: bpf_local_storage: Always use bpf_mem_alloc in PREEMPT_RT
High 7.8
In plain English
A high-severity security flaw 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.1% (higher than 4% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official description
In the Linux kernel, the following vulnerability has been resolved: bpf: bpf_local_storage: Always use bpf_mem_alloc in PREEMPT_RT In PREEMPT_RT, kmalloc(GFP_ATOMIC) is still not safe in non preemptible context. bpf_mem_alloc must be used in PREEMPT_RT. This patch is to enforce bpf_mem_alloc in the bpf_local_storage when CONFIG_PREEMPT_RT is enabled. [ 35.118559] BUG: sleeping function called from invalid context at kernel/locking/spinlock_rt.c:48 [ 35.118566] in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 1832, name: test_progs [ 35.118569] preempt_count: 1, expected: 0 [ 35.118571] RCU nest depth: 1, expected: 1 [ 35.118577] INFO: lockdep is turned off. ... [ 35.118647] __might_resched+0x433/0x5b0 [ 35.118677] rt_spin_lock+0xc3/0x290 [ 35.118700] ___slab_alloc+0x72/0xc40 [ 35.118723] __kmalloc_noprof+0x13f/0x4e0 [ 35.118732] bpf_map_kzalloc+0xe5/0x220 [ 35.118740] bpf_selem_alloc+0x1d2/0x7b0 [ 35.118755] bpf_local_storage_update+0x2fa/0x8b0 [ 35.118784] bpf_sk_storage_get_tracing+0x15a/0x1d0 [ 35.118791] bpf_prog_9a118d86fca78ebb_trace_inet_sock_set_state+0x44/0x66 [ 35.118795] bpf_trace_run3+0x222/0x400 [ 35.118820] __bpf_trace_inet_sock_set_state+0x11/0x20 [ 35.118824] trace_inet_sock_set_state+0x112/0x130 [ 35.118830] inet_sk_state_store+0x41/0x90 [ 35.118836] tcp_set_state+0x3b3/0x640 There is no need to adjust the gfp_flags passing to the bpf_mem_cache_alloc_flags() which only honors the GFP_KERNEL. The verifier has ensured GFP_KERNEL is passed only in sleepable context. It has been an old issue since the first introduction of the bpf_local_storage ~5 years ago, so this patch targets the bpf-next. bpf_mem_alloc is needed to solve it, so the Fixes tag is set to the commit when bpf_mem_alloc was first used in the bpf_local_storage.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian:13 | linux | 6.12.13-1 | DEBIAN-CVE-2024-58070 |
| Debian:14 | linux | 6.12.13-1 | DEBIAN-CVE-2024-58070 |
| Ubuntu:24.04:LTS | linux | 6.8.0-64.67 | UBUNTU-CVE-2024-58070 |
| Ubuntu:24.04:LTS | linux | 6.8.0-64.67 | USN-7651-1 |
| Ubuntu:22.04:LTS | linux-allwinner-5.19 | no fix listed | UBUNTU-CVE-2024-58070 |
| Ubuntu:24.04:LTS | linux-aws | 6.8.0-1032.34 | UBUNTU-CVE-2024-58070 |
| Ubuntu:24.04:LTS | linux-aws | 6.8.0-1032.34 | USN-7651-1 |
| Ubuntu:22.04:LTS | linux-aws-5.19 | no fix listed | UBUNTU-CVE-2024-58070 |
| Ubuntu:22.04:LTS | linux-aws-6.2 | no fix listed | UBUNTU-CVE-2024-58070 |
| Ubuntu:22.04:LTS | linux-aws-6.5 | no fix listed | UBUNTU-CVE-2024-58070 |
| Ubuntu:22.04:LTS | linux-aws-6.8 | 6.8.0-1032.34~22.04.1 | USN-7651-3 |
| Ubuntu:22.04:LTS | linux-aws-6.8 | 6.8.0-1032.34~22.04.1 | UBUNTU-CVE-2024-58070 |
| Ubuntu:24.04:LTS | linux-azure | 6.8.0-1034.39 | UBUNTU-CVE-2024-58070 |
| Ubuntu:22.04:LTS | linux-azure-5.19 | no fix listed | UBUNTU-CVE-2024-58070 |
| Ubuntu:24.04:LTS | linux-azure-6.11 | 6.11.0-1015.15~24.04.1 | UBUNTU-CVE-2024-58070 |
| Ubuntu:22.04:LTS | linux-azure-6.2 | no fix listed | UBUNTU-CVE-2024-58070 |
| Ubuntu:22.04:LTS | linux-azure-6.5 | no fix listed | UBUNTU-CVE-2024-58070 |
| Ubuntu:22.04:LTS | linux-azure-6.8 | 6.8.0-1034.39~22.04.1 | UBUNTU-CVE-2024-58070 |
| Ubuntu:22.04:LTS | linux-azure-fde-5.19 | no fix listed | UBUNTU-CVE-2024-58070 |
| Ubuntu:22.04:LTS | linux-azure-fde-6.2 | no fix listed | UBUNTU-CVE-2024-58070 |
| Ubuntu:24.04:LTS | linux-azure-nvidia | 6.8.0-1022.23 | UBUNTU-CVE-2024-58070 |
| Ubuntu:24.04:LTS | linux-gcp | 6.8.0-1033.35 | UBUNTU-CVE-2024-58070 |
| Ubuntu:24.04:LTS | linux-gcp | 6.8.0-1033.35 | USN-7651-4 |
| Ubuntu:22.04:LTS | linux-gcp-5.19 | no fix listed | UBUNTU-CVE-2024-58070 |
| Ubuntu:24.04:LTS | linux-gcp-6.11 | 6.11.0-1015.15~24.04.1 | UBUNTU-CVE-2024-58070 |
| Ubuntu:22.04:LTS | linux-gcp-6.2 | no fix listed | UBUNTU-CVE-2024-58070 |
| Ubuntu:22.04:LTS | linux-gcp-6.5 | no fix listed | UBUNTU-CVE-2024-58070 |
| Ubuntu:22.04:LTS | linux-gcp-6.8 | 6.8.0-1033.35~22.04.1 | UBUNTU-CVE-2024-58070 |
| Ubuntu:22.04:LTS | linux-gcp-6.8 | 6.8.0-1033.35~22.04.1 | USN-7651-4 |
| Ubuntu:24.04:LTS | linux-gke | 6.8.0-1028.32 | USN-7651-3 |
| Ubuntu:24.04:LTS | linux-gke | 6.8.0-1028.32 | UBUNTU-CVE-2024-58070 |
| Ubuntu:24.04:LTS | linux-gkeop | 6.8.0-1015.17 | UBUNTU-CVE-2024-58070 |
| Ubuntu:24.04:LTS | linux-gkeop | 6.8.0-1015.17 | USN-7651-3 |
| Ubuntu:22.04:LTS | linux-hwe-5.19 | no fix listed | UBUNTU-CVE-2024-58070 |
| Ubuntu:24.04:LTS | linux-hwe-6.11 | 6.11.0-26.26~24.04.1 | UBUNTU-CVE-2024-58070 |
| Ubuntu:22.04:LTS | linux-hwe-6.2 | no fix listed | UBUNTU-CVE-2024-58070 |
| Ubuntu:22.04:LTS | linux-hwe-6.5 | no fix listed | UBUNTU-CVE-2024-58070 |
| Ubuntu:22.04:LTS | linux-hwe-6.8 | 6.8.0-64.67~22.04.1 | UBUNTU-CVE-2024-58070 |
| Ubuntu:24.04:LTS | linux-ibm | 6.8.0-1029.29 | USN-7651-2 |
| Ubuntu:24.04:LTS | linux-ibm | 6.8.0-1029.29 | UBUNTU-CVE-2024-58070 |
| Ubuntu:22.04:LTS | linux-ibm-6.8 | 6.8.0-1029.29~22.04.1 | UBUNTU-CVE-2024-58070 |
| Ubuntu:22.04:LTS | linux-ibm-6.8 | 6.8.0-1029.29~22.04.1 | USN-7651-2 |
| Ubuntu:22.04:LTS | linux-intel-iot-realtime | no fix listed | UBUNTU-CVE-2024-58070 |
| Ubuntu:24.04:LTS | linux-lowlatency | 6.8.0-64.67.1 | USN-7651-2 |
| Ubuntu:24.04:LTS | linux-lowlatency | 6.8.0-64.67.1 | UBUNTU-CVE-2024-58070 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-5.19 | no fix listed | UBUNTU-CVE-2024-58070 |
| Ubuntu:24.04:LTS | linux-lowlatency-hwe-6.11 | 6.11.0-1014.15~24.04.1 | UBUNTU-CVE-2024-58070 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-6.2 | no fix listed | UBUNTU-CVE-2024-58070 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-6.5 | no fix listed | UBUNTU-CVE-2024-58070 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-6.8 | 6.8.0-64.67.1~22.04.1 | USN-7651-2 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-6.8 | 6.8.0-64.67.1~22.04.1 | UBUNTU-CVE-2024-58070 |
| Ubuntu:24.04:LTS | linux-nvidia | 6.8.0-1031.34 | UBUNTU-CVE-2024-58070 |
| Ubuntu:24.04:LTS | linux-nvidia | 6.8.0-1031.34 | USN-7651-3 |
| Ubuntu:24.04:LTS | linux-nvidia-6.11 | 6.11.0-1010.10 | UBUNTU-CVE-2024-58070 |
| Ubuntu:22.04:LTS | linux-nvidia-6.2 | no fix listed | UBUNTU-CVE-2024-58070 |
| Ubuntu:22.04:LTS | linux-nvidia-6.5 | no fix listed | UBUNTU-CVE-2024-58070 |
| Ubuntu:22.04:LTS | linux-nvidia-6.8 | 6.8.0-1031.34~22.04.1 | USN-7651-3 |
| Ubuntu:22.04:LTS | linux-nvidia-6.8 | 6.8.0-1031.34~22.04.1 | UBUNTU-CVE-2024-58070 |
| Ubuntu:24.04:LTS | linux-nvidia-lowlatency | 6.8.0-1031.34.1 | UBUNTU-CVE-2024-58070 |
| Ubuntu:24.04:LTS | linux-nvidia-lowlatency | 6.8.0-1031.34.1 | USN-7651-3 |
| Ubuntu:24.04:LTS | linux-nvidia-tegra | 6.8.0-1008.8 | UBUNTU-CVE-2024-58070 |
| Ubuntu:22.04:LTS | linux-oem-5.17 | no fix listed | UBUNTU-CVE-2024-58070 |
| Ubuntu:22.04:LTS | linux-oem-6.0 | no fix listed | UBUNTU-CVE-2024-58070 |
| Ubuntu:22.04:LTS | linux-oem-6.1 | no fix listed | UBUNTU-CVE-2024-58070 |
| Ubuntu:24.04:LTS | linux-oem-6.11 | 6.11.0-1022.22 | UBUNTU-CVE-2024-58070 |
| Ubuntu:22.04:LTS | linux-oem-6.5 | no fix listed | UBUNTU-CVE-2024-58070 |
| Ubuntu:24.04:LTS | linux-oem-6.8 | 6.8.0-1031.31 | USN-7651-1 |
| Ubuntu:24.04:LTS | linux-oem-6.8 | 6.8.0-1031.31 | UBUNTU-CVE-2024-58070 |
| Ubuntu:24.04:LTS | linux-oracle | 6.8.0-1029.30 | USN-7651-3 |
| Ubuntu:24.04:LTS | linux-oracle | 6.8.0-1029.30 | UBUNTU-CVE-2024-58070 |
| Ubuntu:22.04:LTS | linux-oracle-6.5 | no fix listed | UBUNTU-CVE-2024-58070 |
| Ubuntu:22.04:LTS | linux-oracle-6.8 | 6.8.0-1029.30~22.04.1 | UBUNTU-CVE-2024-58070 |
| Ubuntu:22.04:LTS | linux-oracle-6.8 | 6.8.0-1029.30~22.04.1 | USN-7651-3 |
| Ubuntu:24.04:LTS | linux-raspi | 6.8.0-1031.35 | USN-7651-6 |
| Ubuntu:24.04:LTS | linux-raspi | 6.8.0-1031.35 | UBUNTU-CVE-2024-58070 |
| Ubuntu:24.04:LTS | linux-raspi-realtime | no fix listed | UBUNTU-CVE-2024-58070 |
| Ubuntu:22.04:LTS | linux-realtime | no fix listed | UBUNTU-CVE-2024-58070 |
| Ubuntu:24.04:LTS | linux-realtime | no fix listed | UBUNTU-CVE-2024-58070 |
| Ubuntu:22.04:LTS | linux-riscv | no fix listed | UBUNTU-CVE-2024-58070 |
| Ubuntu:24.04:LTS | linux-riscv | no fix listed | UBUNTU-CVE-2024-58070 |
| Ubuntu:22.04:LTS | linux-riscv-5.19 | no fix listed | UBUNTU-CVE-2024-58070 |
| Ubuntu:22.04:LTS | linux-riscv-6.5 | no fix listed | UBUNTU-CVE-2024-58070 |
| Ubuntu:22.04:LTS | linux-riscv-6.8 | 6.8.0-64.67~22.04.1 | UBUNTU-CVE-2024-58070 |
| Ubuntu:22.04:LTS | linux-starfive-5.19 | no fix listed | UBUNTU-CVE-2024-58070 |
| Ubuntu:22.04:LTS | linux-starfive-6.2 | no fix listed | UBUNTU-CVE-2024-58070 |
| Ubuntu:22.04:LTS | linux-starfive-6.5 | no fix listed | UBUNTU-CVE-2024-58070 |
| Ubuntu:24.04:LTS | linux-xilinx | 6.8.0-1017.18 | UBUNTU-CVE-2024-58070 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| Linux | Linux | 08a7ce384e33e53e0732c500a8af67a73f8fceca – before 3392fa605d7c5708c5fbe02e4fbdac547c3b735208a7ce384e33e53e0732c500a8af67a73f8fceca – before b0027500000dfcb8ee952557d565064cea22c43e08a7ce384e33e53e0732c500a8af67a73f8fceca – before c1d398a3af7e59d7fef351c84fed7ebb575d1f1a08a7ce384e33e53e0732c500a8af67a73f8fceca – before 8eef6ac4d70eb1f0099fff93321d90ce8fa49ee1 |
| Linux | Linux | 6.4 |
Weakness: CWE-667 · Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H