data built 2026-10-19T13:16:53Z

Look up another CVE · open CVE-2024-58098 in the interactive tracker

CVE-2024-58098

bpf: track changes_pkt_data property for global functions

7.8 EPSS 0.2% AV:L

Published 2025-05-05 (17 months ago) by the Linux kernel CNA. Subsystem include/linux. Debian urgency: not yet assigned.

What to do, per Debian release

Debian's own status for CVE-2024-58098 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

ReleaseStatus VersionWhat this means
Debian 12bookwormvulnerable6.1.190-1No 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 13trixiefixed6.12.25-1Update the kernel and reboot. Fixed in 6.12.25-1. A running kernel keeps the old code until the machine restarts.
Debian 14forkyfixed6.12.25-1Update the kernel and reboot. Fixed in 6.12.25-1. A running kernel keeps the old code until the machine restarts.
Debian unstablesidfixed6.12.25-1Update the kernel and reboot. Fixed in 6.12.25-1. A running kernel keeps the old code until the machine restarts.

The vulnerability

What the bug is

When processing calls to certain helpers, verifier invalidates all packet pointers in a current state. For example, consider the following program: __attribute__((__noinline__)) long skb_pull_data(struct __sk_buff *sk, __u32 len) { return bpf_skb_pull_data(sk, len); } SEC("tc") int test_invalidate_checks(struct __sk_buff *sk) { int *p = (void *)(long)sk->data; if ((void *)(p + 1) > (void *)(long)sk->data_end) return TCX_DROP; skb_pull_data(sk, 0); *p = 42; return TCX_PASS; } After a call to bpf_skb_pull_data() the pointer 'p' can't be used safely. See function filter.c:bpf_helper_changes_pkt_data() for a list of such helpers. At the moment verifier invalidates packet pointers when processing helper function calls, and does not traverse global sub-programs when processing calls to global sub-programs. This means that calls to helpers done from global sub-programs do not invalidate pointers in the caller state. E.g. the program above is unsafe, but is not rejected by verifier. This commit fixes the omission by computing field bpf_subprog_info->changes_pkt_data for each sub-program before main verification pass. changes_pkt_data should be set if: - subprogram calls helper for which bpf_helper_changes_pkt_data returns true; - subprogram calls a global function, for which bpf_subprog_info->changes_pkt_data should be set. The verifier.c:check_cfg() pass is modified to compute this information. The commit relies on depth first instruction traversal done by check_cfg() and absence of recursive function calls: - check_cfg() would eventually visit every call to subprogram S in a state when S is fully explored; - when S is fully explored: - every direct helper call within S is explored (and thus changes_pkt_data is set if needed); - every call to subprogram S1 called by S was visited with S1 fully explored (and thus S inherits changes_pkt_data from S1). The downside of such approach is that dead code elimination is not taken into account: if a helper call inside global function is dead because of current configuration, verifier would conservatively assume that the call occurs for the purpose of the changes_pkt_data computation.

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.

include/linux/bpf_verifier.h
kernel/bpf/verifier.c

What this is
BPF [CORE]MAINTAINERS section matched on include/linux/bpf* · bpf@vger.kernel.org · Maintained

Check it on the machine

grep -wE 'CONFIG_BPF|CONFIG_BPF_SYSCALL' /boot/config-$(uname -r)

Reads the booted kernel's own configuration, on the machine and nowhere else. =y is built in, =m is a module, and an is not set line means the code is not there.

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
Build switches
CONFIG_BPF, CONFIG_BPF_SYSCALL
Reads as
all on means the file is compiled; any one off means it is not.

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 kbuild Makefiles 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.19%, higher than 8.5% of all CVEssource
CISA KEV
not listedthe KEV catalogue
Debian urgency
not yet assignedsource
Subsystem
include/linux

Upstream fixes

The versions the CNA records as introducing and fixing this, and the commit for each. source

IntroducedFixed inCommit
5.66.6.9079751e9227a5
5.66.12.251d572c60488b
5.66.1351081a3f25c7

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
Exploitation requires loading a crafted eBPF program via the local `bpf(BPF_PROG_LOAD)` syscall and attaching it (tc/XDP/sockmap), all of which are local operations. No remote peer can reach the verifier.
AC:LAttack complexity, low
The verifier omission is deterministic — the attacker writes the global subprogram, the bounds check, and the stale-pointer dereference, then triggers it with a packet on an interface they control. No race and no uncontrolled precondition.
PR:LPrivileges required, low
The affected program types need CAP_BPF/CAP_NET_ADMIN, but `bpf_token_capable()` evaluates these against `token->userns` through `bpf_ns_capable()`, so BPF-token delegation grants them to an unprivileged process in a user namespace; the same capabilities are commonly held by non-root container-networking daemons.
UI:NUser interaction, none
The attacker loads, attaches, and triggers the program entirely on their own; no victim action of any kind is needed.
S:UScope, unchanged
The corruption is of kernel heap memory within the same kernel security authority — a conventional local privilege-escalation path, with no VM, IOMMU, or sandbox boundary crossed.
C:HConfidentiality impact, high
The stale `PTR_TO_PACKET` dereferences a `kfree()`d `skb->head` (or reads past a shrunk buffer), giving attacker-chosen-offset reads of freed/adjacent kernel heap memory that can be exfiltrated to userspace via a BPF map.
I:HIntegrity impact, high
The same dangling pointer is writable with attacker-controlled offset and data (`*p = 42` in the PoC), yielding a use-after-free/out-of-bounds kernel heap write primitive that can be groomed into control-flow hijack or privilege escalation.
A:HAvailability impact, high
Writing through a freed or out-of-bounds skb data pointer corrupts the slab allocator's state and neighbouring objects, reliably producing an oops or panic even when full exploitation is not achieved.