bitVakt

Kernel Kit / Infix / v26.10.0latest

CVE-2021-20194

7.8high

linux6.18.60 · 6.18.54 · 6.18.8 · 6.12.21in 4 of 4 releases

Reach linux · 8 builds in 4 of 4 releases

full reviewcross-check✓ a member decided

Description · NVD

There is a vulnerability in the linux kernel versions higher than 5.2 (if kernel compiled with config params CONFIG_BPF_SYSCALL=y , CONFIG_BPF=y , CONFIG_CGROUPS=y , CONFIG_CGROUP_BPF=y , CONFIG_HARDENED_USERCOPY not set, and BPF hook to getsockopt is registered). As result of BPF execution, the local user can trigger bug in __cgroup_bpf_run_filter_getsockopt() function that can lead to heap overflow (because of non-hardened usercopy). The impact of attack could be deny of service or possibly privileges escalation.

Published 2021-02-23NVD

CVSS 3.1Local · low privileges · no user interaction

How it is reached

Attack vector
Local
Attack complexity
Low
Privileges required
Low
User interaction
None

What it costs

Confidentiality
High
Integrity
High
Availability
High
Scope
Unchanged

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

References 2
Review Av26.10.0x86_64False positive✓ accepted by a member, 2026-11-12 · settles 8 of 8

Fable 5.1 · high confidence · 2026-11-05

CVE-2021-20194 is the missing bounds check on the BPF-program-supplied optlen in __cgroup_bpf_run_filter_getsockopt() (introduced in 5.3, fixed upstream in 5.11 by Stanislav Fomichev's "bpf: Return -EFAULT when BPF program returns optlen > max_optlen" / related getsockopt fixes).

The kernel in this build is 6.18.60, far past the fixed version, and kernel/bpf/cgroup.c in the tree contains the fix: the ctx.optlen > max_optlen || ctx.optlen < 0 check that returns -EFAULT before any copy_to_sockptr(), and the copy is bounded by ctx.optlen which has already been validated.

None of the 139 Buildroot patches touch BPF/cgroup/sockopt code.

NVD's range-free CPE match against linux_kernel 6.18.60 is a mis-match; the build is not affected, although the preconditions named in the description (BPF_SYSCALL, CGROUPS, CGROUP_BPF enabled, HARDENED_USERCOPY unset) do happen to be true for this .config.

Evidence 6

…/ is output/build/linux-6.18.60/

  1. Fix present: after running the getsockopt BPF programs, `if (!sockptr_is_null(optval) && (ctx.optlen > max_optlen || ctx.optlen < 0))` returns -EFAULT (or ignores the buffer for >PAGE_SIZE case), preventing the overflowing copy.

    …/kernel/bpf/cgroup.c:2208-2218

  2. copy_to_sockptr(optval, ctx.optval, ctx.optlen) only runs after optlen has been bounds-checked against max_optlen.

    …/kernel/bpf/cgroup.c:2220-2230

  3. The kernel-internal variant __cgroup_bpf_run_filter_getsockopt_kern also enforces `ctx.optlen > *optlen || ctx.optlen < 0` -> -EFAULT.

    …/kernel/bpf/cgroup.c:2267-2268

  4. VERSION=6 PATCHLEVEL=18 SUBLEVEL=60; kernel is well past the 5.11 fix.

    …/Makefile:1-4

  5. CONFIG_BPF=y, CONFIG_BPF_SYSCALL=y, CONFIG_CGROUPS=y, CONFIG_CGROUP_BPF=y, CONFIG_HARDENED_USERCOPY not set, CONFIG_BPF_UNPRIV_DEFAULT_OFF=y — the CVE's config preconditions are met, so the determination rests on the fix being present in the code (it is).

    …/.config

  6. 139 Buildroot/Infix patches applied; none match bpf, cgroup or sockopt, so nothing reintroduces the vulnerable code.

    …/.applied_patches_list

Version and patches

Affected: 5.3 ≤ linux < 5.11 (bug introduced by 0d01da6afc54 "bpf: implement getsockopt and setsockopt hooks", fixed in 5.11 / stable 5.10.x backports with the optlen > max_optlen -EFAULT check). This build: 6.18.60, fix present in kernel/bpf/cgroup.c. No applied patch touches the affected code. NVD CPE match on 6.18.60 does not reflect the real affected range.

Recommendation

No action; document as N/A (false positive — NVD version range does not fit; fix present in 6.18.60 source). Optionally consider enabling CONFIG_HARDENED_USERCOPY as general hardening, but it is not needed for this CVE.

Open questions

None. (Not evaluated, since not required: whether any default service attaches a cgroup getsockopt BPF program — CONFIG_BPF_UNPRIV_DEFAULT_OFF=y means attaching such a program needs CAP_BPF/CAP_SYS_ADMIN anyway.)

Members of Kernel Kit decide. Sign in if you are one.