Bug 1979662 (CVE-2021-36084)

Summary: CVE-2021-36084 libsepol: use-after-free in __cil_verify_classperms()
Product: [Other] Security Response Reporter: Guilherme de Almeida Suckevicz <gsuckevi>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: caswilli, dwalsh, fjansen, jnakfour, kaycoth, lvrabec, mmalik, plautrba, psegedy, vmojzis, vmugicag
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-11-10 00:22:54 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1980276, 1979663, 1983515, 1983516, 1983517, 1983518, 1983817    
Bug Blocks: 1979670    

Description Guilherme de Almeida Suckevicz 2021-07-06 16:47:46 UTC
The CIL compiler in SELinux 3.2 has a use-after-free in __cil_verify_classperms (called from __cil_verify_classpermission and __cil_pre_verify_helper).

References:
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=31065
https://github.com/google/oss-fuzz-vulns/blob/main/vulns/selinux/OSV-2021-417.yaml

Upstream patch:
https://github.com/SELinuxProject/selinux/commit/f34d3d30c8325e4847a6b696fe7a3936a8a361f3

Comment 1 Guilherme de Almeida Suckevicz 2021-07-06 16:48:05 UTC
Created libsepol tracking bugs for this issue:

Affects: fedora-all [bug 1979663]

Comment 5 Garrett Tucker 2021-07-26 13:56:31 UTC
selinux/libsepol is mostly local access and to perform this attack would require local access as compared to network access. An attacker would also require some form of privileges to write the policy file and compile the CIL. The availability impact is also low as this flaw would not cause a system wide or complete lack of availability. Instead the attack would only impact availability of selinux temporarily.

Comment 6 errata-xmlrpc 2021-11-09 19:03:24 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

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

Comment 7 Product Security DevOps Team 2021-11-10 00:22:51 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-36084