CVE-2021-47607
Last modified
CVE-2021-47607 is a medium-severity vulnerability rated 5.5/10 on the CVSS scale. 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. EPSS estimates a 0.25% chance of exploitation in the next 30 days.
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.
Metrics
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N
Affected Software
| Vendor | Product | Versions | Update |
|---|---|---|---|
| Linux | Linux Kernel | >= 5.12, < 5.15.11 | — |
| Linux | Linux Kernel | 5.16 | Rc1 |
References
Timeline
- Published
- Last Modified
- Status
- Modified
Frequently Asked Questions
What is CVE-2021-47607?
How severe is CVE-2021-47607?
How do I fix CVE-2021-47607?
How Strix Helps
- How Strix found a critical auth bypass in etcdStrix autonomously discovered a critical authentication bypass in etcd, later designated CVE-2026-33413.
- Autonomous PentestingAI agents that find and validate exploitable vulnerabilities like this one across your applications.
- PR ReviewsPentest every pull request so vulnerable code is caught before it ships to production.
- AI Penetration TestingHow AI-driven penetration testing continuously covers your attack surface.
Related CVEs from 2021
- CVE-2021-47601In the Linux kernel, the following vulnerability has been re…5.5
- CVE-2021-47602In the Linux kernel, the following vulnerability has been re…5.5
- CVE-2021-47603In the Linux kernel, the following vulnerability has been re…4.4
- CVE-2021-47604In the Linux kernel, the following vulnerability has been re…7.1
- CVE-2021-47605In the Linux kernel, the following vulnerability has been re…7.8
- CVE-2021-47606In the Linux kernel, the following vulnerability has been re…5.5
- CVE-2021-47608In the Linux kernel, the following vulnerability has been re…5.5
- CVE-2021-47609In the Linux kernel, the following vulnerability has been re…7.8
- CVE-2021-47610In the Linux kernel, the following vulnerability has been re…5.5
- CVE-2021-47611In the Linux kernel, the following vulnerability has been re…5.5
- CVE-2021-47612In the Linux kernel, the following vulnerability has been re…5.5
- CVE-2021-47613In the Linux kernel, the following vulnerability has been re…7.8
Are you affected by CVE-2021-47607?
Run a free Strix scan to check your systems for this vulnerability.
Scan your code nowSource: NVD / NIST
