CVE-2021-3489 Linux kernel eBPF RINGBUF map oversized allocation

High 7.8 Published Updated

An attacker can trigger out-of-bounds writes in the Linux kernel eBPF ring buffer, leading to arbitrary code execution.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Local or same network only
Victim action needed
Not needed
Fix
Available

What is CVE-2021-3489?

CVE-2021-3489 is a high-severity memory corruption vulnerability in Canonical Ubuntu Linux, published on 4 Jun 2021. It can only be exploited from the same machine or local network, with no action from the victim.

Official description

The eBPF RINGBUF bpf_ringbuf_reserve() function in the Linux kernel did not check that the allocated size was smaller than the ringbuf size, allowing an attacker to perform out-of-bounds writes within the kernel and therefore, arbitrary code execution. This issue was fixed via commit 4b81ccebaeee ("bpf, ringbuf: Deny reserve of buffers larger than ringbuf") (v5.13-rc4) and backported to the stable kernels in v5.12.4, v5.11.21, and v5.10.37. It was introduced via 457f44363a88 ("bpf: Implement BPF ring buffer and verifier support for it") (v5.8-rc1).

Weakness: CWE-787, CWE-119

Which versions are affected by CVE-2021-3489?

It affects 2 products.

Products include Canonical Ubuntu Linux, Linux kernel.

How do I fix CVE-2021-3489?

Apply the vendor's patch.

Upgrade to the fixed version. Memory-safe languages, compiler hardening and fuzzing prevent most new cases. More about Memory corruption.

Is CVE-2021-3489 being exploited?

There is no known exploitation of CVE-2021-3489 in the wild and no public exploit code.

All Canonical Ubuntu Linux vulnerabilities

Sources

Also known as A-190877279, DEBIAN-CVE-2021-3489, GHSA-45wv-rq2g-2vvj, PUB-A-190877279, UBUNTU-CVE-2021-3489.

Is CVE-2021-3489 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free