CVE-2021-47607

bpf: Fix kernel address leakage in atomic cmpxchg's r0 aux reg

MEDIUM
5.5
CVSS Score
Published: June 19, 2024 at 02:54 PM UTC
Updated: June 17, 2026 at 04:18 AM UTC
1 product affected across 1 vendorLinux Kernel

Using Linux by Linux?

Get instant alerts when new vulnerabilities affect Linux - before attackers find them.

Real-time alertsTrack your software stackFree plan available
Severity
MEDIUM5.5
Exploit prediction
EPSS 0.2%
SSVC
No known exploit

Description

In the Linux kernel, the following vulnerability has been resolved: bpf: Fix kernel address leakage in atomic cmpxchg's r0 aux reg The implementation of BPF_CMPXCHG on a high level has the following parameters: .-[old-val] .-[new-val] BPF_R0 = cmpxchg{32,64}(DST_REG + insn->off, BPF_R0, SRC_REG) `-[mem-loc] `-[old-val] Given a BPF insn can only have two registers (dst, src), the R0 is fixed and used as an auxilliary register for input (old value) as well as output (returning old value from memory location). While the verifier performs a number of safety checks, it misses to reject unprivileged programs where R0 contains a pointer as old value. Through brute-forcing it takes about ~16sec on my machine to leak a kernel pointer with BPF_CMPXCHG. The PoC is basically probing for kernel addresses by storing the guessed address into the map slot as a scalar, and using the map value pointer as R0 while SRC_REG has a canary value to detect a matching address. Fix it by checking R0 for pointers, and reject if that's the case for unprivileged programs.

Affected

Our own answer: ranges merged, affected separated from platform-only, with confidence and review flags.

5.12 ≤ v < 5.15.115.12 ≤ v < 5.165.16 rc15.16 rc25.16 rc35.16 rc45.16 rc55ffa25502b5ab3d639829a2d1e316cff7f59a41e
Vendor states this is fixed in a82fe085f344ef20b452cd5f481010ff96b5c4cd (fixed)
Vendor states this is fixed in f87a6c160ecc8c7b417d25f508d3f076fe346136 (fixed)
Vendor states this is fixed in 5.12 (unaffected)
Vendor states this is fixed in 5.15.11 (unaffected)
Vendor states this is fixed in 5.16 (unaffected)

Remediation

No guide yet

No remediation guidance has been written for this CVE yet. What the record does show:

References (2)

Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/a82fe085f344ef20b452cd5f481010ff96b5c4cd
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/f87a6c160ecc8c7b417d25f508d3f076fe346136

SSVC — Action Prioritization

SSVCNo known exploitNot automatablePartial impact

SSVC signals action urgency (what to patch first), separate from CVSS which measures severity.

CVSS

Attack Vector
LOCAL
Complexity
LOW
Privileges
LOW
User Interaction
NONE
Scope
UNCHANGED
Confidentiality
HIGH
Integrity
NONE
Availability
NONE
Vector?

Quick Info

StatusMODIFIED
CWE
NVD-CWE-noinfo

Get alerted

Stop reading CVE feeds looking for your own stack

Track the products you run and VulnTracker tells you when a new CVE affects them — with what is known about fixing it, and nothing about the rest.

Free plan, no card