Bug 1946684 (CVE-2021-29154) - CVE-2021-29154 kernel: Local privilege escalation due to incorrect BPF JIT branch displacement computation
Summary: CVE-2021-29154 kernel: Local privilege escalation due to incorrect BPF JIT br...
Keywords:
Status: CLOSED ERRATA
Alias: CVE-2021-29154
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
URL:
Whiteboard:
Depends On: 1950952 1950953 1950954 1950955 1944798 1947249 1947250 1947251 1947252 1947253 1947631 1947808
Blocks: 1946685
TreeView+ depends on / blocked
 
Reported: 2021-04-06 16:40 UTC by Pedro Sampaio
Modified: 2022-06-16 11:22 UTC (History)
49 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
A flaw was found in the Linux kernels eBPF implementation. By default, accessing the eBPF verifier is only accessible to privileged users with CAP_SYS_ADMIN. A local user with the ability to insert eBPF instructions can abuse a flaw in eBPF to corrupt memory. The highest threat from this vulnerability is to confidentiality, integrity, as well as system availability.
Clone Of:
Environment:
Last Closed: 2021-08-31 11:57:58 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2022:2229 0 None None None 2022-05-12 11:26:15 UTC
Red Hat Product Errata RHBA-2022:4630 0 None None None 2022-05-18 11:45:59 UTC
Red Hat Product Errata RHBA-2022:4693 0 None None None 2022-05-19 05:10:27 UTC
Red Hat Product Errata RHBA-2022:4969 0 None None None 2022-06-08 18:39:29 UTC
Red Hat Product Errata RHBA-2022:5088 0 None None None 2022-06-16 11:22:46 UTC
Red Hat Product Errata RHSA-2021:3327 0 None None None 2021-08-31 09:09:06 UTC
Red Hat Product Errata RHSA-2021:3328 0 None None None 2021-08-31 09:09:23 UTC
Red Hat Product Errata RHSA-2022:1975 0 None None None 2022-05-10 14:38:56 UTC
Red Hat Product Errata RHSA-2022:1988 0 None None None 2022-05-10 14:44:37 UTC

Description Pedro Sampaio 2021-04-06 16:40:41 UTC
An issue has been discovered in the BPF JIT compiler in the Linux kernel that can be abused by priviledged local users (root or CAP_SYS_ADMIN) to escalate privileges. This depends on permission to execute eBPF system call.

Comment 3 Wade Mealing 2021-04-08 04:50:55 UTC
Statement:

This flaw is rated as having Moderate impact as eBPF requires a privileged user on Red Hat Enterprise Linux to correctly load eBPF instructions that can be exploited.

Comment 5 Wade Mealing 2021-04-08 05:13:52 UTC
Mitigation:

To exploit this flaw, an attacker would need to be a privileged user.  The eBPF JIT can not be disabled in the versions of the kernel that ship with RHEL9.  Preventing unprivileged users from becoming root or CAP_SYS_ADMIN , would be enough to prevent an attacker from successfully exploiting this flaw.

Comment 8 Guilherme de Almeida Suckevicz 2021-04-08 18:49:42 UTC
Created kernel tracking bugs for this issue:

Affects: fedora-all [bug 1947631]

Comment 10 Dmitry Iskhakov 2021-04-09 11:31:07 UTC
The following options does not work in Fedora 33:

[root@test ~]# sysctl net.core.bpf_jit_enable=0 
sysctl: setting key "net.core.bpf_jit_enable": Invalid argument

[root@test ~]# echo 0 > /proc/sys/net/core/bpf_jit_enable 
-bash: echo: write error: Invalid argument

I think it has something to do with the kernel build option CONFIG_BPF_JIT_ALWAYS_ON=y

Comment 14 Wade Mealing 2021-05-17 06:05:17 UTC
Yeah, it looks like  CONFIG_BPF_JIT_ALWAYS_ON=y is the default for el7 and el8.  This mitigation isn't going to work.  Fortunately, it's still behind a privileged user requirement to execute eBPF.

Comment 21 errata-xmlrpc 2021-08-31 09:09:02 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7

Via RHSA-2021:3327 https://access.redhat.com/errata/RHSA-2021:3327

Comment 22 errata-xmlrpc 2021-08-31 09:09:21 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7

Via RHSA-2021:3328 https://access.redhat.com/errata/RHSA-2021:3328

Comment 23 Product Security DevOps Team 2021-08-31 11:57:58 UTC
This bug is now closed. Further updates for individual products will be reflected on the CVE page(s):

https://access.redhat.com/security/cve/cve-2021-29154

Comment 24 errata-xmlrpc 2022-05-10 14:38:52 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

Via RHSA-2022:1975 https://access.redhat.com/errata/RHSA-2022:1975

Comment 25 errata-xmlrpc 2022-05-10 14:44:34 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

Via RHSA-2022:1988 https://access.redhat.com/errata/RHSA-2022:1988


Note You need to log in before you can comment on or make changes to this bug.