CVE-2024-46764
published high CVSS 3.1 · 7.3bpf: add check for invalid name in btf_name_valid_section()
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| Linux | — | Linuxbd70a8fb7ca4fcb078086f4d96b048aaf1aa4786 to < c8ffe2d4d37a05ce18c71b87421443c16f8475e5 · bd70a8fb7ca4fcb078086f4d96b048aaf1aa4786 to < bb6705c3f93bed2af03d43691743d4c43e3c8e6f · Other versions: unaffected | Affected | Not stated | Linux |
| Linux | — | Linux6.9 (affected) · 0 to < 6.9 (unaffected · semver) · 6.10.10 through 6.10.* (unaffected · semver) · 6.11 and later (unaffected · original_commit_for_fix) · Other versions: affected | Version-specific | Not stated | Linux |
| Amazon Linux | AL2 | Release evaluation | Not Affected | Not required | Amazon Linux assessment |
| Amazon Linux | AL2023 | Release evaluation | Not Affected | Not required | Amazon Linux assessment |
Description
In the Linux kernel, the following vulnerability has been resolved: bpf: add check for invalid name in btf_name_valid_section() If the length of the name string is 1 and the value of name[0] is NULL byte, an OOB vulnerability occurs in btf_name_valid_section() and the return value is true, so the invalid name passes the check. To solve this, you need to check if the first position is NULL byte and if the first character is printable.
Related advisories
Vendor advisories explicitly linked to this CVE.
No linked advisories were found for this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 3.1
- Base score
- 7.3 / 10
- Severity
- high
- Provider
- Linux · cna
- Vector string
- CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:H
- Scenarios
- en: AV:L - The only path to `btf_name_valid_section()` is the `bpf(BPF_BTF_LOAD)` syscall (`bpf_btf_load()` → `btf_new_fd()` → `btf_parse()` → `btf_datasec_check_meta()`), which requires local access to submit an attacker-crafted BTF blob. No network- or peer-supplied data reaches BTF parsing. AC:L - The attacker fully controls the BTF blob and can set a DATASEC `name_off` to exactly `hdr.str_len - 1`, which `btf_check_meta()` accepts and which is guaranteed by `btf_parse_str_sec()` to be the last byte of the allocation, so the `src++` walks off the end every single time. By choosing a page-aligned blob above `KMALLOC_MAX_SIZE` the attacker also forces the `kvmalloc()` vmalloc fallback so the first OOB byte lands on the vmalloc guard page — a 100% reproducible, single-shot trigger with no race and no layout luck. PR:L - `bpf_btf_load()` gates on `bpf_token_capable(token, CAP_BPF)`, which under a BPF token (present in every affected version, v6.9–v6.11) degrades to `ns_capable(token->userns, CAP_BPF)`, so a non-root user inside a delegated user namespace — or any unprivileged service account granted ambient CAP_BPF, as CNI/observability agents routinely are — can load arbitrary BTF. This is a low-privilege local account, not real root in the init namespace. UI:N - The attacker performs the entire sequence itself with a single `bpf(BPF_BTF_LOAD)` call on a blob it constructs; no other user or process needs to act. S:U - The out-of-bounds read occurs in kernel heap/vmalloc memory within the same security authority that hosts the calling process; no VM, IOMMU, or sandbox boundary is crossed. C:H - The loop reads up to `KSYM_NAME_LEN` (512) bytes of adjacent kernel memory past the end of the `kvmalloc()` allocation — far beyond a strictly bounded few-byte overread — exposing neighbouring slab contents that the attacker can groom, with the boolean load result acting as an oracle on that data. I:L - The bug is a validation bypass as well as an overread: removing the `src++` in the fix shows the pre-fix code never checked the first character, so both empty names and names with a leading non-printable/control byte were admitted into kernel-held BTF state and are surfaced in verifier-log output and via `BPF_BTF_GET_FD_BY_ID` to consuming tooling. There is no write primitive, so the integrity effect is limited rather than arbitrary. A:H - With a page-aligned BTF blob above `KMALLOC_MAX_SIZE`, `kvmalloc()` falls back to `vmalloc()`, which appends a guard page in `__get_vm_area_node()`, so the very first out-of-bounds byte dereferences unmapped kernel memory and produces an unhandled paging request / oops (a full panic with `panic_on_oops`). Even in the slab case this is a KASAN-reportable slab-out-of-bounds read, and the trigger is cheap and repeatable.
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| Linux | Linux | bd70a8fb7ca4fcb078086f4d96b048aaf1aa4786 to < c8ffe2d4d37a05ce18c71b87421443c16f8475e5 (affected · git)bd70a8fb7ca4fcb078086f4d96b048aaf1aa4786 to < bb6705c3f93bed2af03d43691743d4c43e3c8e6f (affected · git)Default: unaffected | Linux · cna |
| Linux | Linux | 6.9 (affected)0 to < 6.9 (unaffected · semver)6.10.10 through 6.10.* (unaffected · semver)6.11 and later (unaffected · original_commit_for_fix)Default: affected | Linux · cna |
Weaknesses
0No weakness assertions.
References
2Provider assertions
2Linux · cna
bpf: add check for invalid name in btf_name_valid_section()
CISA-ADP · adp
CISA ADP Vulnrichment
Provenance
- Schema
- 5.2
- Searchable
- yes
- Content hash
- 38ae3e1af7792ecf9a263bd222b12d6dd2d37e6145cbdee8e993837e6e4e6313
- Ingested
- 23 Sep 2026, 08:28:03 UTC
- Source record
- Official CVE record