Bug 1651384 (CVE-2018-18955)

Summary: CVE-2018-18955 kernel: Privilege escalation in map_write() in kernel/user_namespace.c
Product: [Other] Security Response Reporter: Pedro Sampaio <psampaio>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED NOTABUG QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: unspecifiedCC: abhgupta, acaringi, airlied, bhu, blc, brdeoliv, bskeggs, dbaker, dhoward, dvlasenk, ewk, fhrbata, hdegoede, hkrzesin, hwkernel-mgr, iboverma, ichavero, itamar, jarodwilson, jforbes, jglisse, jkacur, john.j5live, jokerman, jonathan, josef, jross, jstancek, jwboyer, kernel-maint, kernel-mgr, labbott, lgoncalv, linville, matt, mchehab, mcressma, mjg59, mlangsdo, nmurray, plougher, rt-maint, rvrbovsk, steved, sthangav, trankin, vdronov, williams
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
A flaw was found in the Linux kernel where map_write() in kernel/user_namespace.c allows privilege escalation as it mishandles nested user namespaces with more than 5 UID or GID ranges. An unprivileged user with CAP_SYS_ADMIN in an affected user namespace can bypass access controls on resources outside the namespace. This is possible because a user/group id transformation takes place properly for the namespaced-to-kernel direction but not for the kernel-to-namespaced direction.
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-06-10 10:42:48 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: 1652679, 1652680, 1652681    
Bug Blocks: 1651385    

Description Pedro Sampaio 2018-11-19 21:20:16 UTC
A security flaw was found in the Linux kernel where map_write() in kernel/user_namespace.c allows privilege escalation as it mishandles nested user namespaces with more than 5 UID or GID ranges. An unprivileged user with CAP_SYS_ADMIN in an affected user namespace can bypass access controls on resources outside the namespace. This is possible because a user/group id transformation takes place properly for the namespaced-to-kernel direction but not for the kernel-to-namespaced direction.

External References:

https://bugs.chromium.org/p/project-zero/issues/detail?id=1712

https://seclists.org/oss-sec/2018/q4/150

An upstream patch:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d2f007dbe7e4c9583eea6eb04d60001e85c6f1bd

Comment 3 Vladis Dronov 2018-11-22 15:12:26 UTC
Created kernel tracking bugs for this issue:

Affects: fedora-all [bug 1652681]

Comment 6 Justin M. Forbes 2018-11-26 12:41:44 UTC
This was fixed for Fedora with the 4.19.2 kernel rebase.

Comment 8 Petr Matousek 2021-03-05 14:42:38 UTC
Statement:

This issue does not affect the Linux kernel versions as shipped with Red Hat Enterprise Linux 5, 6 and 7 because they did not include the commit that introduced this issue.

This issue does not affect Red Hat Enterprise Linux 8 because the fix for this issue has been included since the Red Hat Enterprise Linux 8 release.