kernel: integer overflow and out-of-bounds write in kernel/bpf/hashtab.c when many elements are placed in a single bucket
Published Aug 7, 2021
7.8
HIGHCVSS 3.1
EPSS 0.32%
Description
In kernel/bpf/hashtab.c in the Linux kernel through 5.13.8, there is an integer overflow and out-of-bounds write when many elements are placed in a single bucket. NOTE: exploitation might be impractical without the CAP_SYS_ADMIN capability.
Affected products
No data.
Configuration 1
- ≥ 5.6 · < 5.10.60
- ≥ 5.11 · < 5.13.12
Configuration 2
- 33
- 34
Configuration 3
- 11.0
No data.
Red Hat Enterprise Linux 6
kernel
Not affected
Red Hat Enterprise Linux 7
kernel
Not affected
Red Hat Enterprise Linux 7
kernel-alt
Out of support scope
Red Hat Enterprise Linux 7
kernel-rt
Not affected
Red Hat Enterprise Linux 8
kernel
Affected
Red Hat Enterprise Linux 8
kernel-rt
Affected
Red Hat Enterprise Linux 9
kernel
Not affected
| Product | Package | State | Advisory |
|---|---|---|---|
| Red Hat Enterprise Linux 6 | kernel | Not affected | n/a |
| Red Hat Enterprise Linux 7 | kernel | Not affected | n/a |
| Red Hat Enterprise Linux 7 | kernel-alt | Out of support scope | n/a |
| Red Hat Enterprise Linux 7 | kernel-rt | Not affected | n/a |
| Red Hat Enterprise Linux 8 | kernel | Affected | n/a |
| Red Hat Enterprise Linux 8 | kernel-rt | Affected | n/a |
| Red Hat Enterprise Linux 9 | kernel | Not affected | n/a |
No package ranges for this CVE.
Remediation
Red Hat mitigation
The default Red Hat Enterprise Linux kernel setting prevents unprivileged users from being able to use eBPF via the kernel.unprivileged_bpf_disabled sysctl. As such, exploiting this issue would require a privileged user with CAP_SYS_ADMIN or root. For the Red Hat Enterprise Linux 7 the eBPF for unprivileged users is always disabled. For the Red Hat Enterprise Linux 8 to confirm the current state, inspect the sysctl with the command: cat /proc/sys/kernel/unprivileged_bpf_disabled The setting of 1 (default) would mean that unprivileged users cannot use eBPF. Otherwise, to disable eBPF for unprivileged users, add: kernel.unprivileged_bpf_disabled = 1 To the file "/etc/sysctl.d/disable-ebpf.conf" Then running the following command as root: # sudo sysctl --system
References (11)
- https://access.redhat.com/security/cve/CVE-2021-38166 Vendor Advisory
- https://bugzilla.redhat.com/show_bug.cgi?id=1993190 Issue Tracking
- https://euvd.enisa.europa.eu/vulnerability/EUVD-2021-24636 Advisory
- https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf.git/commit/?id=c4eb1f403243fc7bbb7de644db8587c03de36da6 x_refsource_MISCPatchVendor Advisory
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/GUVLBJKZMWA3E3YXSH4SZ7BOYGJP4GXP/ vendor-advisoryx_refsource_FEDORAThird Party Advisory
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/UL6CH5M5PRLMA3KPBX4LPUO6Z73GRISO/ vendor-advisoryx_refsource_FEDORAThird Party Advisory
- https://lore.kernel.org/bpf/20210806150419.109658-1-th.yasumatsu%40gmail.com/ x_refsource_MISCPatch
- https://nvd.nist.gov/vuln/detail/CVE-2021-38166
- https://security.netapp.com/advisory/ntap-20210909-0001/ x_refsource_CONFIRMThird Party Advisory
- https://www.cve.org/CVERecord?id=CVE-2021-38166
- https://www.debian.org/security/2021/dsa-4978 vendor-advisoryx_refsource_DEBIANThird Party Advisory
Change history (0)
No recorded changes yet.