(CVE-2012-0056) CVE-2012-0056 kernel: proc: /proc/<pid>/mem mem_write insufficient permission checking

Bug #920586 reported by Jeff Johnson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
rosa
In Progress
High
Unassigned
CentOS
Fix Released
High

Bug Description

Tracker

Tags: kernel

CVE References

Revision history for this message
In , Eugene (eugene-redhat-bugs) wrote :

From Linus' patch:
"Jüri Aedla reported that the /proc/<pid>/mem handling really isn't very robust, and it also doesn't match the permission checking of any of the other related files.

This changes it to do the permission checks at open time, and instead of tracking the process, it tracks the VM at the time of the open. That simplifies the code a lot, but does mean that if you hold the file descriptor open over an execve(), you'll continue to read from the _old_ VM."

A local, unprivileged user could use this flaw to escalate their privileges.

Upstream commit:
http://git.kernel.org/linus/e268337dfe26dfc7efd422a804dbb27977a3cccc

Acknowledgements:

Red Hat would like to thank Jüri Aedla for reporting this issue.

Revision history for this message
In , Eugene (eugene-redhat-bugs) wrote :

Statement:

This issue did not affect the version of Linux kernel as shipped with Red Hat Enterprise Linux 4 and 5 as it did not backport the upstream commit 198214a7ee. This has been addressed in Red Hat Enterprise Linux 6 and Red Hat Enterprise MRG via https://rhn.redhat.com/errata/RHSA-2012-0052.html and https://rhn.redhat.com/errata/RHSA-2012-0061.html. For more information, please read https://access.redhat.com/kb/docs/DOC-69129.

Revision history for this message
In , Eugene (eugene-redhat-bugs) wrote :

Created kernel tracking bugs for this issue

Affects: fedora-all [bug 782681]

Revision history for this message
In , Eugene (eugene-redhat-bugs) wrote :

Ensure that ASLR is enabled, see /proc/sys/kernel/randomize_va_space.

Revision history for this message
In , Eugene (eugene-redhat-bugs) wrote :

Created attachment 556461
A reproducer that tests if we have commit 198214a7.

Revision history for this message
In , Petr (petr-redhat-bugs) wrote :

To mitigate the issue:

1) On the host, save the following in a file with the ".stp" extension:

probe kernel.function("mem_write@fs/proc/base.c").call {
  $count = 0
}

2) Install the "systemtap" package and any required dependencies. Refer to
the "2. Using SystemTap" chapter in the Red Hat Enterprise Linux 6
"SystemTap Beginners Guide" document, available from docs.redhat.com, for
information on installing the required -debuginfo packages.

3) Run the "stap -g [filename-from-step-1].stp" command as root.

If the host is rebooted, the changes will be lost and the script must be
run again.

Revision history for this message
In , Murray (murray-redhat-bugs) wrote :

Knowledgebase article for this issue: https://access.redhat.com/kb/docs/DOC-69129

Revision history for this message
In , Eugene (eugene-redhat-bugs) wrote :

Linux Local Privilege Escalation via SUID /proc/pid/mem Write
http://blog.zx2c4.com/749

Revision history for this message
In , Eugene (eugene-redhat-bugs) wrote :

This was shared on oss-security list on Jan 18, http://seclists.org/oss-sec/2012/q1/178. All Linux distro representatives are (expected to be) subscribed to this list.

Revision history for this message
In , Eugene (eugene-redhat-bugs) wrote :
Revision history for this message
In , Eugene (eugene-redhat-bugs) wrote :

Spender modified the reproducer to make it work on PaX, http://grsecurity.net/~spender/correct_proc_mem_reproducer.c

Revision history for this message
In , Eugene (eugene-redhat-bugs) wrote :
Jeff Johnson (n3npq)
tags: added: kernel
Changed in rosa:
status: New → In Progress
importance: Undecided → High
milestone: none → 2012-01
Revision history for this message
In , errata-xmlrpc (errata-xmlrpc-redhat-bugs) wrote :

This issue has been addressed in following products:

  Red Hat Enterprise Linux 6

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

Revision history for this message
In , Petr (petr-redhat-bugs) wrote :
Revision history for this message
In , errata-xmlrpc (errata-xmlrpc-redhat-bugs) wrote :

This issue has been addressed in following products:

  MRG for RHEL-6 v.2

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

Revision history for this message
In , Eugene (eugene-redhat-bugs) wrote :

LWN: A /proc/PID/mem vulnerability
https://lwn.net/Articles/476947/

Changed in centos:
importance: Unknown → High
status: Unknown → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.