# CVE-2021-47317: powerpc/bpf: Fix detecting BPF atomic instructions

- Severity: High 7.8 (CVSS:3.1, scored by Linux) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.19%, higher than 8% of CVEs (2026-12-01)
- Published: 2024-05-21T14:35:33.212Z
- Modified: 2026-08-05T08:47:15.685Z
- Weaknesses: CWE-667
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: Linux

## 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.

(As written by CVE List.)

## Affected

- Linux Linux: from 91c960b0056672e74627776655c926388350fa30 before 7284dab07e4d51d453cc42851fae9ec4fac6ef2f; from 91c960b0056672e74627776655c926388350fa30 before 0d435b6d94b05dcfd836d758a63145aa566618e2; from 91c960b0056672e74627776655c926388350fa30 before 419ac821766cbdb9fd85872bb3f1a589df05c94c; 5.12 (not affected: before 5.12; from 5.12.19 up to 5.12.*; from 5.13.4 up to 5.13.*; from 5.14 up to *)
- linux linux_kernel: from 5.12 before 5.12.19; from 5.13 before 5.13.4

## Every score

- Linux: CVSS:3.1 7.8 High `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- NVD: CVSS:3.1 3.3 Low `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:L`

## References

- <https://git.kernel.org/stable/c/7284dab07e4d51d453cc42851fae9ec4fac6ef2f> (patch)
- <https://git.kernel.org/stable/c/0d435b6d94b05dcfd836d758a63145aa566618e2> (patch)
- <https://git.kernel.org/stable/c/419ac821766cbdb9fd85872bb3f1a589df05c94c> (patch)

## Sources

- CVE List: [CVE-2021-47317](https://www.cve.org/CVERecord?id=CVE-2021-47317), CVE Terms of Use, modified 2026-08-05
- NVD: [CVE-2021-47317](https://nvd.nist.gov/vuln/detail/CVE-2021-47317), Public domain, modified 2026-08-04

---

Page: https://cve.day/CVE-2021-47317 · Whole record: https://cve.day/CVE-2021-47317.json · Rebuilt by cve.day 2026-11-25T22:58:08.794Z
