Exploit database

Vulnerability

CVE-2021-3490

Linux kernel eBPF bitwise ops ALU32 bounds tracking

Vulnerability details

Score
7.8
Severity
high

CVSS 3.1 · canonical

Vector string

CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H

Description

The eBPF ALU32 bounds tracking for bitwise ops (AND, OR and XOR) in the Linux kernel did not properly update 32-bit bounds, which could be turned into out of bounds reads and writes in the Linux kernel and therefore, arbitrary code execution. This issue was fixed via commit 049c4e13714e ("bpf: Fix alu32 const subreg bound tracking on bitwise operations") (v5.13-rc4) and backported to the stable kernels in v5.12.4, v5.11.21, and v5.10.37. The AND/OR issues were introduced by commit 3f50f132d840 ("bpf: Verifier, do explicit ALU32 bounds tracking") (5.7-rc1) and the XOR variant was introduced by 2921c90d4718 ("bpf:Fix a verifier failure with xor") ( 5.10-rc1).

CVE Program

Exploit source choices

11 sources
Linux eBPF ALU32 32-bit Invalid Bounds Tracking LPE
MSF-linux--local--cve_2021_3490_ebpf_alu32_bounds_check_lpeMetasploitLinux / remotePreferred

Linux kernels from 5.7-rc1 prior to 5.13-rc4, 5.12.4, 5.11.21, and 5.10.37 are vulnerable to a bug in the eBPF verifier's verification of ALU32 operations in the scalar32_min_max_and function when performing AND operations, whereby under certain conditions the bounds of a 32 bit register would not be properly updated. This can be abused by attackers to conduct an out of bounds read and write in the Linux kernel and therefore achieve arbitrary code execution as the root user. The target system must be compiled with eBPF support and not have kernel.unprivileged_bpf_disabled set, which prevents unprivileged users from loading eBPF programs into the kernel. Note that if kernel.unprivileged_bpf_disabled is enabled this module can still be utilized to bypass protections such as SELinux, however the user must already be logged as a privileged user such as root.

2021-05-11cve_2021_3490_ebpf_alu32_bounds_check_lpe.rb
0xsyr0/oscp
GH-1e9613ea0d155c33d16520580dbed873GitHubUnofficial GitHub source

OSCP Cheat Sheet

2021-10-2262 files · 3,887 stars
bsauce/kernel-exploit-factory
GH-19aa051ff5153014d6646f547e3c4467GitHubUnofficial GitHub source

Linux kernel CVE exploit analysis report and relative debug environment. You don't need to compile Linux kernel and configure your environment anymore.

2020-12-11262 files · 1,308 stars
bsauce/kernel-security-learning
GH-c4865ec2b4e2c29d85b0e20b1503912fGitHubUnofficial GitHub source

Anything about kernel security. CTF kernel pwn, kernel exploit, kernel fuzz and kernel defense paper, kernel debugging technique, kernel CVE debug.

2019-11-2798 files · 783 stars
al1ex/linuxeelvation
GH-82dd0da071ea66f05194b9f200dbcaeeGitHubUnofficial GitHub source

Linux Eelvation(持续更新)

2021-03-30302 files · 412 stars
chujdk/d3ctf2022-pwn-d3bpf-and-v2
GH-5a2f6a9e7b4417f5257120cac6a0303cGitHubUnofficial GitHub source

D^3CTF 2022 d3bpf, d3bpf-v2 attachment, exp and official writeup

2022-03-0718 files · 13 stars
pivik271/cve-2021-3490
GH-ec677c22cb32bb6124cf5fd8fd2a554fGitHubUnofficial GitHub source

pivik271/cve-2021-3490 source repository

2023-04-064 files · 2 stars
abdofarid1/r00tkeep3r
GH-ee31953c2282d61abf2228c679f56bbdGitHubUnofficial GitHub source

abdofarid1/r00tkeep3r source repository

2025-08-28668 files · 0 stars