Bug 1272371 (CVE-2015-7872)

Summary: CVE-2015-7872 kernel: Keyrings crash triggerable by unprivileged user
Product: [Other] Security Response Reporter: Adam Mariš <amaris>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: unspecifiedCC: aquini, arm-mgr, bhu, blc, carnil, dhoward, fhrbata, gansalmon, iboverma, itamar, jbastian, jforbes, jindrich.novy, jkacur, joelsmith, jonathan, jross, jwboyer, kernel-maint, kernel-mgr, kstutsma, lgoncalv, madhu.chinakonda, matt, mchehab, mcressma, mlangsdo, mrg-program-list, nmurray, plougher, pmatouse, rt-maint, rvrbovsk, slawomir, slong, vgoyal, vvs, williams, wmealing
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
It was found that the Linux kernel's keys subsystem did not correctly garbage collect uninstantiated keyrings. A local attacker could use this flaw to crash the system or, potentially, escalate their privileges on the system.
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-06-08 02:44:10 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On: 1272172, 1273463, 1273465, 1275926, 1275927, 1275928, 1275929, 1275930, 1275931, 1275932, 1275933, 1275934, 1291660    
Bug Blocks: 1272373    

Description Adam Mariš 2015-10-16 09:35:42 UTC
A vulnerability in the Linux kernel's keyrings garbage collector allowing any local user account to trigger a kernel panic.

Problem arrises when using request_key() or keyctl request2.

This code sequence tries to invoke an upcall to instantiate a keyring if one doesn't already exist by that name within the user's keyring set. However, if the upcall fails, the code sets keyring->type_data.reject_error to -ENOKEY or some other error code.  When the key is garbage collected, the key destroy function is called unconditionally and keyring_destroy() uses list_empty() on keyring->type_data.link - which is in a union with reject_error. Subsequently, the kernel tries to unlink the keyring from the keyring names list, which leads to an oops.

Comment 2 Adam Mariš 2015-10-20 11:43:54 UTC
CVE request:


Comment 4 Wade Mealing 2015-10-30 05:41:58 UTC

This issue affects the Linux kernels as shipped with Red Hat Enterprise Linux 6 , 7 and Red Hat MRG 2. Future updates for the respective releases may address this flaw.

Comment 10 errata-xmlrpc 2015-12-15 13:59:25 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 6

Via RHSA-2015:2636 https://rhn.redhat.com/errata/RHSA-2015-2636.html

Comment 12 errata-xmlrpc 2016-02-16 10:48:55 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7

Via RHSA-2016:0212 https://rhn.redhat.com/errata/RHSA-2016-0212.html

Comment 13 errata-xmlrpc 2016-02-16 11:19:17 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7

Via RHSA-2016:0185 https://rhn.redhat.com/errata/RHSA-2016-0185.html

Comment 14 errata-xmlrpc 2016-02-16 15:05:22 UTC
This issue has been addressed in the following products:

  MRG for RHEL-6 v.2

Via RHSA-2016:0224 https://rhn.redhat.com/errata/RHSA-2016-0224.html