oss-sec mailing list archives

CVE-2021-3600 - Linux kernel eBPF 32-bit source register truncation on div/mod


From: Thadeu Lima de Souza Cascardo <cascardo () canonical com>
Date: Wed, 23 Jun 2021 13:07:42 -0300

It was discovered that eBPF 32-bit div/mod source register truncation could
lead to out-of-bounds reads and writes in the kernel.

It was introduced by commit 68fda450a7df ("bpf: fix 32-bit divide by zero"). It
was first introduced in 4.15-rc9, but backported and applied to v4.14.y, v4.9.y
and v4.4.y. However, this specific attack will not work on v4.4.y and v4.9.y
kernels as pointer arithmetic is prohibited on those kernels. This was
introduced by commit f1174f77b50c ("bpf/verifier: rework value tracking"), in
v4.14-rc1.

The fix is commit e88b2c6e5a4d ("bpf: Fix 32 bit src register truncation on
div/mod"), introduced in v5.11. It was backported and applied on v5.10.y and
v5.4.y, but not v4.19.y and v4.14.y.

Cascardo.


Current thread: