title: Linux kernel bpf verifier vulnerability
description: In the Linux kernel 5.5.0 and newer, the bpf verifier (kernel/bpf/verifier.c) did not properly restrict the register bounds for 32-bit operations, leading to out-of-bounds reads and writes in kernel memory. The vulnerability also affects the Linux 5.4 stable series, starting with v5.4.7, as the introducing commit was backported to that branch. This vulnerability was fixed in 5.6.1, 5.5.14, and 5.4.29. (issue is aka ZDI-CAN-10780)
affected:
{
product: Linux kernel
vendor: Linux kernel
versions:
lessThan: 5.6.1, status: affected, version: 5.6-stable, versionType: custom
lessThan: 5.5.14, status: affected, version: 5.5-stable, versionType: custom
changes: [at: 5.4.29, status: unaffected], lessThan: 5.4-stable*, status: affected, version: 5.4.7, versionType: custom
}
metrics:
cvssV3_1: [
attackComplexity: HIGH
attackVector: LOCAL
availabilityImpact: HIGH
baseScore: 7.8
baseSeverity: HIGH
confidentialityImpact: HIGH
integrityImpact: HIGH
privilegesRequired: LOW
scope: CHANGED
userInteraction: NONE
vectorString: CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H
version: 3.1
]
solutions: Revert commit 581738a681b6 ("bpf: Provide better register bounds after jmp32 instructions").
workarounds: Mitigation for this vulnerability is available by setting the kernel.unprivileged_bpf_disabled sysctl to 1:
$ sudo sysctl kernel.unprivileged_bpf_disabled=1
$ echo kernel.unprivileged_bpf_disabled=1 |  sudo tee /etc/sysctl.d/90-CVE-2020-8835.conf
This issue is also mitigated on systems that use secure boot with the kernel lockdown feature which blocks BPF program loading.