Bug 1356471 (CVE-2016-6213)

Summary: CVE-2016-6213 kernel: Overflowing kernel mount table using shared bind mount
Product: [Other] Security Response Reporter: Adam Mariš <amaris>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: unspecifiedCC: aquini, arm-mgr, avagin, bhu, caiqian, carnil, dhoward, fhrbata, gansalmon, iboverma, itamar, jforbes, jkacur, joelsmith, jonathan, jross, jwboyer, kernel-maint, kernel-mgr, kir, kstutsma, labbott, lgoncalv, madhu.chinakonda, matt, mchehab, mcressma, nmurray, plougher, rt-maint, rvrbovsk, slawomir, vdronov, williams
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
It was found that in Linux kernel the mount table expands by a power-of-two with each bind mount command. If a system is configured to allow non-privileged user to do bind mounts, or allows to do so in a container or unprivileged mount namespace, then non-privileged user is able to cause a local DoS by overflowing the mount table, which causes a deadlock for the whole system.
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-06-08 02:56:15 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: 1322495, 1356472    
Bug Blocks: 1332565, 1356474    

Description Adam Mariš 2016-07-14 08:09:18 UTC
It was found that in Linux kernel the mount table expands by a power-of-two with each bind mount command. If a system is configured to allow non-privileged user to do bind mounts, or allows to do so in a container or unprivileged mount namespace, then non-privileged user is able to cause a local DoS by overflowing the mount table, which causes a deadlock for the whole system.

CVE request:

http://seclists.org/oss-sec/2016/q3/56

Proofs:

http://seclists.org/oss-sec/2016/q3/65

http://seclists.org/oss-sec/2016/q3/75

Discussions:

https://lkml.org/lkml/2013/6/17/143

Comment 1 Adam Mariš 2016-07-14 08:09:39 UTC
Acknowledgments:

Name: Qian Cai (Red Hat)

Comment 2 Adam Mariš 2016-07-14 08:10:10 UTC
Created kernel tracking bugs for this issue:

Affects: fedora-all [bug 1356472]

Comment 3 Josh Boyer 2016-07-14 13:08:54 UTC
It seems there is some debate on whether the CVE is actually something the kernel needs to fix.  I'll hold off a bit on this one.

Comment 4 Adam Mariš 2016-07-15 06:58:43 UTC
Another reproducer using Docker:

http://seclists.org/oss-sec/2016/q3/65

Comment 5 Andrej Nemec 2016-07-18 06:55:03 UTC
Another reproducer which doesn't use Docker, but it needs user namespaces to be enabled:

http://seclists.org/oss-sec/2016/q3/75

Comment 6 Andrew Vagin 2016-07-22 00:05:46 UTC
I've reported this problem two years ago
https://lkml.org/lkml/2013/6/20/709

Comment 7 Kir Kolyshkin 2016-07-28 18:02:27 UTC
(In reply to Andrew Vagin from comment #6)
> I've reported this problem two years ago
> https://lkml.org/lkml/2013/6/20/709

It's actually three years ago.

Comment 9 Vladis Dronov 2016-08-30 13:50:21 UTC
Statement:

This issue does not affect the Linux kernel packages as shipped with Red Hat Enterprise Linux 5, 6, 7 and MRG-2 as of now due to the absence of unprivileged mount name spaces support.

Nevertheless, the unprivileged mount name spaces might be added to a future RHEL-7 version as a supported feature, so future Linux kernel updates for the respective releases might address this issue.

Comment 10 Andrew Vagin 2016-09-01 23:00:57 UTC
https://lkml.org/lkml/2016/8/28/269

Comment 11 errata-xmlrpc 2017-08-01 19:08:48 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7

Via RHSA-2017:2077 https://access.redhat.com/errata/RHSA-2017:2077

Comment 12 errata-xmlrpc 2017-08-02 07:47:42 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7

Via RHSA-2017:1842 https://access.redhat.com/errata/RHSA-2017:1842