CVE-2021-47317
published high CVSS 3.1 · 7.8powerpc/bpf: Fix detecting BPF atomic instructions
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| Linux | — | Linux91c960b0056672e74627776655c926388350fa30 to < 7284dab07e4d51d453cc42851fae9ec4fac6ef2f · 91c960b0056672e74627776655c926388350fa30 to < 0d435b6d94b05dcfd836d758a63145aa566618e2 · 91c960b0056672e74627776655c926388350fa30 to < 419ac821766cbdb9fd85872bb3f1a589df05c94c · Other versions: unaffected | Affected | Not stated | Linux |
| Linux | — | Linux5.12 (affected) · 0 to < 5.12 (unaffected · semver) · 5.12.19 through 5.12.* (unaffected · semver) · 5.13.4 through 5.13.* (unaffected · semver) · 5.14 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: powerpc/bpf: Fix detecting BPF atomic instructions Commit 91c960b0056672 ("bpf: Rename BPF_XADD and prepare to encode other atomics in .imm") converted BPF_XADD to BPF_ATOMIC and added a way to distinguish instructions based on the immediate field. Existing JIT implementations were updated to check for the immediate field and to reject programs utilizing anything more than BPF_ADD (such as BPF_FETCH) in the immediate field. However, the check added to powerpc64 JIT did not look at the correct BPF instruction. Due to this, such programs would be accepted and incorrectly JIT'ed resulting in soft lockups, as seen with the atomic bounds test. Fix this by looking at the correct immediate value.
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.8 / 10
- Severity
- high
- Provider
- Linux · cna
- Vector string
- CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- Scenarios
- en: AV:L - The bug is in the powerpc64 eBPF JIT (bpf_jit_build_body) and is reached only by loading a BPF program via the local bpf() syscall (or classic SO_ATTACH_FILTER → eBPF migration), not by processing remote network input. AC:L - The attacker fully controls the BPF bytecode; arranging insn[0].imm == 0 so the broken insn->imm check accepts BPF_FETCH/other atomics and JITs them as plain ADD is deterministic, with no race or attacker-uncontrollable layout required. PR:L - Unprivileged users can load BPF_PROG_TYPE_SOCKET_FILTER when kernel.unprivileged_bpf_disabled=0 (upstream default for most of the 5.12–5.14 window before BPF_UNPRIV_DEFAULT_OFF), and even CAP_BPF-gated loading is Low (non-admin) privilege per kernel CNA BPF JIT scoring precedent. UI:N - The attacker loads and triggers their own crafted BPF program; no separate victim action is required. S:U - Impact stays in the host kernel’s BPF/JIT authority (local DoS or privilege escalation) and does not cross a VM, IOMMU, or other security-boundary. C:H - Incorrect JIT of BPF_FETCH leaves the src register with the attacker-controlled addend while the verifier propagates stack bounds/constants into that register, so later map/memory indexing can perform out-of-bounds reads relative to verifier assumptions. I:H - The same verifier/JIT mismatch turns constrained offsets into attacker-controlled ones for stores, and unsupported atomics (AND/OR/XOR/XCHG/CMPXCHG) are emitted as ADD, yielding memory corruption and potential control-flow hijack primitives. A:H - As documented (atomic bounds test), JITing FETCH as ADD leaves a non-zero register so a verifier-proven-dead infinite loop runs in kernel context, causing soft lockups/hangs that are Availability High.
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| Linux | Linux | 91c960b0056672e74627776655c926388350fa30 to < 7284dab07e4d51d453cc42851fae9ec4fac6ef2f (affected · git)91c960b0056672e74627776655c926388350fa30 to < 0d435b6d94b05dcfd836d758a63145aa566618e2 (affected · git)91c960b0056672e74627776655c926388350fa30 to < 419ac821766cbdb9fd85872bb3f1a589df05c94c (affected · git)Default: unaffected | Linux · cna |
| Linux | Linux | 5.12 (affected)0 to < 5.12 (unaffected · semver)5.12.19 through 5.12.* (unaffected · semver)5.13.4 through 5.13.* (unaffected · semver)5.14 and later (unaffected · original_commit_for_fix)Default: affected | Linux · cna |
Weaknesses
0No weakness assertions.
References
3Provider assertions
3Linux · cna
powerpc/bpf: Fix detecting BPF atomic instructions
CISA-ADP · adp
CISA ADP Vulnrichment
CVE · adp
CVE Program Container
Provenance
- Schema
- 5.2
- Searchable
- yes
- Content hash
- 99dc4737032203f11b6f7f57a9731694eac311e8a35e9de491e37356f8913413
- Ingested
- 23 Sep 2026, 07:57:11 UTC
- Source record
- Official CVE record