Look up another CVE · open CVE-2024-58237 in the interactive tracker
CVE-2024-58237
bpf: consider that tail calls invalidate packet pointers
Published 2025-05-05 (17 months ago) by the Linux kernel CNA. Subsystem net/core. Debian urgency: not yet assigned.
What to do, per Debian release
Debian's own status for CVE-2024-58237 in every release this site tracks, and what each one means in practice. Every status below is the one the Debian Security Team publishes for this CVE. source
| Release | Status | Version | What this means |
|---|---|---|---|
| Debian 12bookworm | vulnerable | 6.1.190-1 | No fix published anywhere yet, neither in Debian nor upstream for the series bookworm tracks. Watch the Debian tracker page for this CVE. Advisories for bookworm have historically landed a median of 23 days after publication. |
| Debian 13trixie | fixed | 6.12.9-1 | Update the kernel and reboot. Fixed in 6.12.9-1. A running kernel keeps the old code until the machine restarts. |
| Debian 14forky | fixed | 6.12.9-1 | Update the kernel and reboot. Fixed in 6.12.9-1. A running kernel keeps the old code until the machine restarts. |
| Debian unstablesid | fixed | 6.12.9-1 | Update the kernel and reboot. Fixed in 6.12.9-1. A running kernel keeps the old code until the machine restarts. |
The vulnerability
What the bug is
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.
Where it lives
The fix touches these files. If the subsystem is one you do not use, the practical exposure is lower, though the package is still the vulnerable one.
net/core/filter.c
tools/testing/selftests/bpf/progs/tc_bpf2bpf.c
- What this is
- BPF [GENERAL] (Safe Dynamic Programs and Tools)MAINTAINERS section matched on net/core/filter.c · bpf@vger.kernel.org · Supported
Show whether Debian builds this, per release
Debian builds this code. Every release below compiles the affected file into the kernels it ships.
- bookworm, trixie, forky, sidy
- y
- built into the kernel image on every flavour - only a patch removes it
From the configuration Debian publishes for every kernel flavour it builds. It covers only the architectures Debian ships a linux-config package for, and nothing about a kernel you built yourself. Debian's own status above stays authoritative about the source package.MAINTAINERS Debian linux-config packages
Signals
- Published
- 2025-05-05 (17 months ago)source
- CVSS
- 7.8 high
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:Hsource recompute it - Attack vector
- local (AV:L)source
- EPSS
- 0.20%, higher than 8.7% of all CVEssource
- CISA KEV
- not listedthe KEV catalogue
- Debian urgency
- not yet assignedsource
- Subsystem
- net/core
Upstream fixes
The versions the CNA records as introducing and fixing this, and the commit for each. source
| Introduced | Fixed in | Commit |
|---|---|---|
| 5.6 | 6.6.90 | f1692ee23dca |
| 5.6 | 6.12.9 | 1c2244437f9a |
| 5.6 | 6.13 | 1a4607ffba35 |
Why the CNA scored it this way
Quoted from the kernel CNA's own scoring file, word for word. A highlighted metric carries the most severe value CVSS v3.1 defines for it, which is what pushes the score up. source
- AV:LAttack vector, local
- The vulnerability is a BPF verifier flaw triggered by loading a crafted eBPF program through the bpf() syscall; the resulting memory corruption occurs during local packet processing controlled by the attacker, requiring local access.
- AC:LAttack complexity, low
- The attacker fully controls the malicious program, its subprogram/tail-call structure, and the heap grooming, so acceptance by the buggy verifier and the subsequent stale-pointer dereference are fully reliable with no attacker-uncontrolled conditions.
- PR:LPrivileges required, low
- Reaching the flaw requires loading a packet-processing eBPF program (e.g., SCHED_CLS/tc) which needs the CAP_BPF/CAP_NET_ADMIN privilege over the BPF subsystem — a limited, delegatable privilege over the component rather than full root.
- UI:NUser interaction, none
- The attacker loads, attaches, and triggers the malicious program entirely on their own; no action by any other user is required.
- S:UScope, unchanged
- The verifier bypass corrupts kernel heap memory within the kernel's own security authority; there is no crossing into a different security scope such as a VM or IOMMU boundary.
- C:HConfidentiality impact, high
- The stale packet pointer permits out-of-bounds reads of reallocated/adjacent kernel heap memory, allowing disclosure of sensitive kernel data.
- I:HIntegrity impact, high
- The verifier accepts a program that writes through a stale packet pointer (`*p = 42`), giving a controlled out-of-bounds write to kernel heap memory that can be leveraged into an arbitrary-write/control-flow-hijack primitive.
- A:HAvailability impact, high
- Out-of-bounds reads/writes on reallocated kernel heap memory readily cause kernel memory corruption and panic/oops.