Look up another CVE · open CVE-2024-47703 in the interactive tracker
CVE-2024-47703
bpf, lsm: Add check for BPF LSM return value
Published 2024-10-21 (24 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-47703 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.11.2-1 | Update the kernel and reboot. Fixed in 6.11.2-1. A running kernel keeps the old code until the machine restarts. |
| Debian 14forky | fixed | 6.11.2-1 | Update the kernel and reboot. Fixed in 6.11.2-1. A running kernel keeps the old code until the machine restarts. |
| Debian unstablesid | fixed | 6.11.2-1 | Update the kernel and reboot. Fixed in 6.11.2-1. A running kernel keeps the old code until the machine restarts. |
The vulnerability
What the bug is
A bpf prog returning a positive number attached to file_alloc_security hook makes kernel panic. This happens because file system can not filter out the positive number returned by the LSM prog using IS_ERR, and misinterprets this positive number as a file pointer. Given that hook file_alloc_security never returned positive number before the introduction of BPF LSM, and other BPF LSM hooks may encounter similar issues, this patch adds LSM return value check in verifier, to ensure no unexpected value is returned.
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.h
include/linux/bpf_lsm.h
kernel/bpf/bpf_lsm.c
kernel/bpf/btf.c
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
- 2024-10-21 (24 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.22%, higher than 11.2% 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
| Introduced | Fixed in | Commit |
|---|---|---|
| 5.7 | 6.10.13 | 1050727d83e7 |
| 5.7 | 6.11.2 | 27ca3e20fe80 |
| 5.7 | 6.12 | 5d99e198be27 |
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 by loading and attaching a crafted BPF LSM program through the local `bpf()` syscall and then triggering it with a local `open()`; there is no network or adjacent path into the verifier.
- AC:LAttack complexity, low
- Triggering is fully deterministic and entirely attacker-constructed — load an `SEC("lsm/file_alloc_security")` program that returns a chosen positive constant, attach it, then call `open()` — with no race, no dependence on uncontrolled memory layout, and `CONFIG_BPF_LSM` plus `"bpf"` in the default `CONFIG_LSM` list on mainstream distro and Android kernels.
- PR:LPrivileges required, low
- The attacker needs `CAP_BPF`+`CAP_PERFMON`, which were deliberately split out of `CAP_SYS_ADMIN` so BPF tracing/LSM could be granted to non-administrative principals (observability agents, sidecars, containers), and `bpf_token_capable()` resolves to `ns_capable(token->userns, ...)`, so with a delegating bpffs mount a user-namespace-confined non-root principal can load `BPF_LSM_MAC` programs. This is a constrained delegated privilege whose stated boundary is verifier soundness, not administrative control of the kernel.
- UI:NUser interaction, none
- The attacker performs every step in its own processes — load, attach, and then trigger with its own `open()` call. No victim action, mount, or file access by another user is required.
- S:UScope, unchanged
- Both the flawed component (BPF verifier return-value check) and the impacted component (VFS/kernel memory) are the kernel itself under a single security authority; no VM, IOMMU, or hypervisor boundary is crossed.
- C:HConfidentiality impact, high
- The unchecked positive return becomes an attacker-chosen `struct file *` in the `[1, 0x7FFFFFFF]` user range that `IS_ERR()` fails to reject, so a pre-mapped fake `struct file` with a controlled `f_op` yields arbitrary kernel-memory reads and disclosure; the verifier bypass also lets LSM access-control verdicts be forged, defeating confidentiality enforcement.
- I:HIntegrity impact, high
- A verifier-sanctioned out-of-contract return value hands the VFS a fully attacker-controlled `struct file`, the canonical primitive for arbitrary kernel write and control-flow hijack via `f_op` after `fd_install()`, and independently allows LSM allow/deny decisions to be forged.
- A:HAvailability impact, high
- The commit message documents that a positive `file_alloc_security` return "makes kernel panic" because the filesystem dereferences it as a file pointer; any `open()` on the system then oopses, giving a trivially repeatable full denial of service.