# CVE-2021-47608: bpf: Fix kernel address leakage in atomic fetch

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** MEDIUM 5.5
- **CVSS:** 5.5 (v3.1, NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: None; Availability impact: None
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.29% (percentile 14, 2026-11-26)
- **Published:** 2024-06-19T14:54:06.388Z
- **Modified:** 2026-06-17T04:18:09.287Z

## Who should check

- Anyone running Linux \>= 37086bfdc737ea6f66bf68dcf16757004d68e1e1, \< 423628125a484538111c2c6d9bb1588eb086053b; \>= 37086bfdc737ea6f66bf68dcf16757004d68e1e1, \< 7d3baf0afa3aa9102d6a521a8e4c41888bb79882
- Anyone running Linux 5.12

## Description

In the Linux kernel, the following vulnerability has been resolved:

bpf: Fix kernel address leakage in atomic fetch

The change in commit 37086bfdc737 ("bpf: Propagate stack bounds to registers
in atomics w/ BPF\_FETCH") around check\_mem\_access() handling is buggy since
this would allow for unprivileged users to leak kernel pointers. For example,
an atomic fetch/and with -1 on a stack destination which holds a spilled
pointer will migrate the spilled register type into a scalar, which can then
be exported out of the program (since scalar != pointer) by dumping it into
a map value.

The original implementation of XADD was preventing this situation by using
a double call to check\_mem\_access() one with BPF\_READ and a subsequent one
with BPF\_WRITE, in both cases passing -1 as a placeholder value instead of
register as per XADD semantics since it didn't contain a value fetch. The
BPF\_READ also included a check in check\_stack\_read\_fixed\_off() which rejects
the program if the stack slot is of \_\_is\_pointer\_value() if dst\_regno \< 0.
The latter is to distinguish whether we're dealing with a regular stack spill/
fill or some arithmetical operation which is disallowed on non-scalars, see
also 6e7e63cbb023 ("bpf: Forbid XADD on spilled pointers for unprivileged
users") for more context on check\_mem\_access() and its handling of placeholder
value -1.

One minimally intrusive option to fix the leak is for the BPF\_FETCH case to
initially check the BPF\_READ case via check\_mem\_access() with -1 as register,
followed by the actual load case with non-negative load\_reg to propagate
stack bounds to registers.

## Affected and fixed versions

- Linux: \>= 37086bfdc737ea6f66bf68dcf16757004d68e1e1, \< 423628125a484538111c2c6d9bb1588eb086053b; \>= 37086bfdc737ea6f66bf68dcf16757004d68e1e1, \< 7d3baf0afa3aa9102d6a521a8e4c41888bb79882 (cvelist)
- Linux: 5.12 (cvelist)

## Mitigation

- Upgrade Linux to 7d3baf0afa3aa9102d6a521a8e4c41888bb79882 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2021-47608. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2021-47608.md
Affected: Linux >= 37086bfdc737ea6f66bf68dcf16757004d68e1e1, < 423628125a484538111c2c6d9bb1588eb086053b; >= 37086bfdc737ea6f66bf68dcf16757004d68e1e1, < 7d3baf0afa3aa9102d6a521a8e4c41888bb79882; Linux 5.12
Fixed in: Linux 423628125a484538111c2c6d9bb1588eb086053b, Linux 7d3baf0afa3aa9102d6a521a8e4c41888bb79882

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2021-47608 being exploited?

There is no confirmed exploitation: CVE-2021-47608 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.29% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2021-47608?

Medium: CVSS 5.5 (v3.1, scored by NVD). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2021-47608?

Linux \>= 37086bfdc737ea6f66bf68dcf16757004d68e1e1, \< 423628125a484538111c2c6d9bb1588eb086053b; \>= 37086bfdc737ea6f66bf68dcf16757004d68e1e1, \< 7d3baf0afa3aa9102d6a521a8e4c41888bb79882; Linux 5.12.

### Is there a fix for CVE-2021-47608?

Yes. Fixed in Linux 423628125a484538111c2c6d9bb1588eb086053b, Linux 7d3baf0afa3aa9102d6a521a8e4c41888bb79882. Upgrade Linux to 7d3baf0afa3aa9102d6a521a8e4c41888bb79882 or later.

### How do I check if I'm affected by CVE-2021-47608?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/423628125a484538111c2c6d9bb1588eb086053b>
- patch: <https://git.kernel.org/stable/c/7d3baf0afa3aa9102d6a521a8e4c41888bb79882>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2021-47608>

HTML: <https://flawdb.com/CVE-2021-47608> · JSON: <https://flawdb.com/api/v1/entries/CVE-2021-47608>
