Bug 824345 (CVE-2012-2390)

Summary: CVE-2012-2390 kernel: huge pages: memory leak on mmap failure
Product: [Other] Security Response Reporter: Petr Matousek <pmatouse>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: amaris, anton, arozansk, bhu, dhoward, fhrbata, jackkim, jkacur, kernel-mgr, lgoncalv, lwang, mmilgram, mrg-program-list, security-response-team, sforsber, williams
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard: impact=moderate,public=20120517,reported=20120522,source=internet,cvss2=4.9/AV:L/AC:L/Au:N/C:N/I:N/A:C,rhel-5/kernel=notaffected,rhel-6.3.z/kernel=affected,rhel-6.4/kernel=affected,fedora-all/kernel=affected,mrg-2/realtime-kernel=affected,cwe=CWE-401[auto]
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-08-24 08:45:29 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Bug Depends On: 824350, 824351, 824352, 824353, 824354    
Bug Blocks: 824358    

Description Petr Matousek 2012-05-23 06:18:19 EDT
Description of problem:
When called for anonymous (non-shared) mappings, hugetlb_reserve_pages() does a resv_map_alloc().  It depends on code in hugetlbfs's vm_ops->close() to release that allocation.

However, in the mmap() failure path, we do a plain unmap_region() without the remove_vma() which actually calls vm_ops->close(). 

An unprivileged local user could use this flaw to crash the system.

References:
http://www.spinics.net/lists/linux-mm/msg34763.html

Proposed upstream fix:
https://lkml.org/lkml/2012/5/21/385
Comment 3 Petr Matousek 2012-05-23 06:24:08 EDT
Created kernel tracking bugs for this issue

Affects: fedora-all [bug 824352]
Comment 4 Kurt Seifried 2012-05-23 14:05:10 EDT
Added CVE as per http://www.openwall.com/lists/oss-security/2012/05/23/14
Comment 5 Petr Matousek 2012-05-30 07:01:45 EDT
Upstream commits:
 c50ac050811d6485616a193eb0f37bfbd191cc89
 4523e1458566a0e8ecfaff90f380dd23acc44d27
Comment 9 Fedora Update System 2012-06-06 22:33:21 EDT
kernel-3.4.0-1.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 10 Fedora Update System 2012-06-13 17:30:08 EDT
kernel-3.3.8-1.fc16 has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 11 Fedora Update System 2012-06-22 04:37:59 EDT
kernel-2.6.43.8-1.fc15 has been pushed to the Fedora 15 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 12 Petr Matousek 2012-07-04 01:30:12 EDT
Statement:

This issue did not affect the versions of the Linux kernel as shipped with Red Hat Enterprise Linux 5 as they did not include the upstream commit 84afd99b that introduced this issue. Future kernel updates for Red Hat Enterprise Linux 6 may address this issue.

This has been addressed in Red Hat Enterprise Linux Red Hat Enterprise MRG 2 via https://rhn.redhat.com/errata/RHSA-2012-1150.html
Comment 13 errata-xmlrpc 2012-08-08 12:35:17 EDT
This issue has been addressed in following products:

  MRG for RHEL-6 v.2

Via RHSA-2012:1150 https://rhn.redhat.com/errata/RHSA-2012-1150.html
Comment 14 errata-xmlrpc 2012-09-25 14:59:58 EDT
This issue has been addressed in following products:

  Red Hat Enterprise Linux 6

Via RHSA-2012:1304 https://rhn.redhat.com/errata/RHSA-2012-1304.html