SecurityContext

CVE-2021-47608: Linux Kernel - Information Disclosure & Privilege Escalation

  • Cve: CVE-2021-47608
  • Name: Linux Kernel - Information Disclosure & Privilege Escalation
  • 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.
  • Impact: Unprivileged users can leak kernel addresses, potentially leading to information disclosure or further privilege escalation.
  • Remediation: Apply the patch from commit 37086bfdc737 or update to the latest kernel version where this fix is included.
  • Vulnerability impact: information_disclosure, privilege_escalation
  • Requirement type: none
  • Labels source: projectdiscovery
  • Severity: medium
  • Cvss score: 5.5
  • Cvss vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N
  • Epss score: 0.00211
  • Epss percentile: 0.11135
  • Assignee: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
  • Published at: 2024-06-19T15:15:55Z
  • Age in days: 888
  • Modified at: 2026-06-17T04:18:09Z
  • Patch available: yes
  • References total: 2
  • Products total: 1
  • Oss: yes
  • Projects total: 1
  • Advisory url: https://nvd.nist.gov/vuln/detail/CVE-2021-47608
  • Nvd status: modified
  • Checked, none or zero: known exploited entries, nuclei templates, public exploits total, public exploits capped, public exploits, rejected by nvd
  • Not known: vulnerability type, requirements, hackerone

Cwe

IdName
NVD-CWE-noinfo—

References

UrlSourceTags
https://git.kernel.org/stable/c/423628125a484538111c2c6d9bb1588eb086053bnvdPatch
https://git.kernel.org/stable/c/7d3baf0afa3aa9102d6a521a8e4c41888bb79882nvdPatch

Products

ProductAffectedPlatform boundSourcesUrl
linux:linux_kernel= 5.16 rc1; = 5.16 rc2; = 5.16 rc3; = 5.16 rc4; = 5.16 rc5; >= 5.12, < 5.15.11nonvd/v1/products/linux/linux_kernel

Projects

RepositoryLink kindsIndexedUrl
torvalds/linuxcna_commit, commityes/v1/repositories/torvalds/linux

Index

  • Checked, none or zero: repositories, repositories high signal, packages

Exploitation

  • Authentication required: yes
  • Exposed hosts: 10038339
  • Checked, none or zero: known exploited, known exploited by, exploitation seen, public exploit, public exploit count, initial access, remote
  • Not known: known exploited since, vulncheck known exploited since, public exploit first date, nuclei template, initial access since, hackerone reports