Look up another CVE · open CVE-2024-38564 in the interactive tracker
CVE-2024-38564
bpf: Add BPF_PROG_TYPE_CGROUP_SKB attach type enforcement in BPF_LINK_CREATE
Published 2024-06-19 (2 years ago) by the Linux kernel CNA. Subsystem kernel/bpf. Debian urgency: not yet assigned.
What to do, per Debian release
Debian's own status for CVE-2024-38564 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.8.12-1 | Update the kernel and reboot. Fixed in 6.8.12-1. A running kernel keeps the old code until the machine restarts. |
| Debian 14forky | fixed | 6.8.12-1 | Update the kernel and reboot. Fixed in 6.8.12-1. A running kernel keeps the old code until the machine restarts. |
| Debian unstablesid | fixed | 6.8.12-1 | Update the kernel and reboot. Fixed in 6.8.12-1. A running kernel keeps the old code until the machine restarts. |
The vulnerability
What the bug is
bpf_prog_attach uses attach_type_to_prog_type to enforce proper attach type for BPF_PROG_TYPE_CGROUP_SKB. link_create uses bpf_prog_get and relies on bpf_prog_attach_check_attach_type to properly verify prog_type <> attach_type association. Add missing attach_type enforcement for the link_create case. Otherwise, it's currently possible to attach cgroup_skb prog types to other cgroup hooks.
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.
kernel/bpf/syscall.c
- What this is
- BPF [CORE]MAINTAINERS section matched on kernel/bpf/syscall.c · 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
- 2024-06-19 (2 years 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.24%, higher than 13.9% of all CVEssource
- CISA KEV
- not listedthe KEV catalogue
- Debian urgency
- not yet assignedsource
- Subsystem
- kernel/bpf
Upstream fixes
The versions the CNA records as introducing and fixing this, and the commit for each. source
| Introduced | Fixed in | Commit |
|---|---|---|
| 5.10 | 6.6.33 | 6675c541f540 |
| 5.10 | 6.8.12 | 67929e973f5a |
| 5.10 | 6.9.3 | b34bbc766510 |
| 5.10 | 6.10 | 543576ec15b1 |
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 flaw is reached exclusively through the `bpf(BPF_LINK_CREATE)` syscall and then triggered by an ordinary syscall (e.g. `getsockopt()`) from a process in the target cgroup. Per kernel guidance BPF is Local.
- AC:LAttack complexity, low
- Exploitation is fully deterministic — the attacker authors the cgroup_skb program, chooses the mismatched attach type, picks the target cgroup, and invokes the hook itself; there is no race, no memory-layout dependency, and no special kernel config beyond stock `CONFIG_CGROUP_BPF`.
- PR:LPrivileges required, low
- The attach path requires CAP_NET_ADMIN/CAP_SYS_ADMIN via `bpf_token_capable()`, which on 6.8+ is satisfied by `ns_capable(token->userns, CAP_NET_ADMIN)` — i.e. reachable by container-root inside a BPF-token-delegated user namespace, an unprivileged principal from the host's perspective, matching the PR:L treatment of other BPF-capability-gated kernel.org CVEs.
- UI:NUser interaction, none
- The attacker attaches the link and then triggers the confused hook from its own process; no action by any other user is required.
- S:UScope, unchanged
- The type confusion corrupts kernel memory within the same kernel security authority — a standard local privilege escalation with no VM, IOMMU, or sandbox boundary crossed.
- C:HConfidentiality impact, high
- sk_buff-offset loads against a 12–56 byte stack ctx read kernel stack memory out of bounds, and skb helpers such as `bpf_skb_load_bytes()` dereference wild pointers harvested from that memory, yielding effectively arbitrary kernel memory disclosure exfiltrated through BPF maps.
- I:HIntegrity impact, high
- `cg_skb_is_valid_access` permits writes to `__sk_buff->mark`, `->priority` and `->cb[0..4]`, which compile to raw stores ~0x30–0xa8 bytes past the small stack ctx, giving attacker-controlled out-of-bounds kernel stack writes into caller frames — a control-flow hijack primitive.
- A:HAvailability impact, high
- The wild-pointer dereferences and stack corruption reliably produce a general protection fault, KASAN splat, or panic — this is exactly how syzbot (`syzbot+838346b979830606c854`) surfaced the bug.