CVE-2024-58237 bpf: consider that tail calls invalidate packet pointers
A flaw in the Linux kernel BPF subsystem allows invalid packet pointer access after tail calls, potentially causing a null dereference and denial of service.
- Exploited in the wild
- Not known
- Login needed
- Any signed-in user
- Attackable
- Local or same network only
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2024-58237?
CVE-2024-58237 is a high-severity vulnerability in Linux kernel, published on 5 May 2025. It can only be exploited from the same machine or local network, with no action from the victim.
Official description
In the Linux kernel, the following vulnerability has been resolved:
bpf: consider that tail calls invalidate packet pointers
Tail-called programs could execute any of the helpers that invalidate packet pointers. Hence, conservatively assume that each tail call invalidates packet pointers.
Making the change in bpf_helper_changes_pkt_data() automatically makes use of check_cfg() logic that computes 'changes_pkt_data' effect for global sub-programs, such that the following program could be rejected:
int tail_call(struct __sk_buff *sk) { bpf_tail_call_static(sk, &jmp_table, 0); return 0; }
SEC("tc") int not_safe(struct __sk_buff *sk) { int *p = (void *)(long)sk->data; ... make p valid ... tail_call(sk); *p = 42; /* this is unsafe */ ... }
The tc_bpf2bpf.c:subprog_tc() needs change: mark it as a function that can invalidate packet pointers. Otherwise, it can't be freplaced with tailcall_freplace.c:entry_freplace() that does a tail call.
Weakness: CWE-476
Which versions are affected by CVE-2024-58237?
It affects 1 product.
Products include Linux kernel.
How do I fix CVE-2024-58237?
Apply the vendor's patch.
Is CVE-2024-58237 being exploited?
There is no known exploitation of CVE-2024-58237 in the wild and no public exploit code.
Other vulnerabilities in Linux kernel
Sources
Also known as AZL-69932, BELL-CVE-2024-58237, DEBIAN-CVE-2024-58237, GHSA-hv6f-p3fq-464p, ROOT-OS-DEBIAN-11-CVE-2024-58237, ROOT-OS-DEBIAN-12-CVE-2024-58237 and 2 more.