SecurityTracker.com
    Home    |    View Topics    |    Search    |    Contact Us    |   

SecurityTracker
Archives


 


Category:   OS (Linux)  >   Linux Kernel Vendors:   kernel.org
Linux Kernel mremap() Improper Bounds Checking Lets Local Users Gain Root Privileges
SecurityTracker Alert ID:  1008593
SecurityTracker URL:  http://securitytracker.com/id/1008593
CVE Reference:   CVE-2003-0985   (Links to External Site)
Updated:  Jan 6 2004
Original Entry Date:  Jan 5 2004
Impact:   Denial of service via local system, Execution of arbitrary code via local system, Root access via local system
Fix Available:  Yes  Vendor Confirmed:  Yes  
Version(s): 2.4.x, 2.6.x
Description:   A vulnerability was reported in the Linux kernel do_mremap() function. A local user can gain elevated privileges.

Paul Starzetz and Wojciech Purczynski of iSEC Security Research reported that the mremap(2) system call does not perform proper bounds checking in the do_mremap() kernel code. A local user can reportedly cause the kernel to remap memory and create a virtual memory area that is 0 bytes in length.

According to the report, a local user can gain root privileges on the system through non-trivial exploit methods.

The original advisory is available at:

http://isec.pl/vulnerabilities/isec-0013-mremap.txt

Impact:   A local user can execute arbitrary code with root privileges. A local user can also cause denial of service conditions on the system.
Solution:   Fixes are reportedly available (or pending) for various Linux kernel distributions. As the distributors release their fixes, separate Alerts will be issued [see the Message History].
Vendor URL:  www.kernel.org/ (Links to External Site)
Cause:   Boundary error

Message History:   This archive entry has one or more follow-up message(s) listed below.
Jan 5 2004 (Red Hat Issues Fix for Red Hat Linux) Linux Kernel mremap() Improper Bounds Checking Lets Local Users Gain Root Privileges
Red Hat has released a fix for Red Hat Linux 7.1, 7.2, 7.3, 8.0, and 9.
Jan 5 2004 (EnGarde Issues Fix) Linux Kernel mremap() Improper Bounds Checking Lets Local Users Gain Root Privileges
Guardian Digital has released a fix for EnGarde Secure Linux.
Jan 5 2004 (Conectiva Issues Fix) Linux Kernel mremap() Improper Bounds Checking Lets Local Users Gain Root Privileges
Conectiva has released a fix.
Jan 5 2004 (Trustix Issues Fix) Linux Kernel mremap() Improper Bounds Checking Lets Local Users Gain Root Privileges
Trustix has released a fix.
Jan 5 2004 (Red Hat Issues Fix for RH Enterprise Linux) Linux Kernel mremap() Improper Bounds Checking Lets Local Users Gain Root Privileges
Red Hat has released a fix for Red Hat Enterprise Linux.
Jan 5 2004 (Red Hat Issues Fix for IA64) Linux Kernel mremap() Improper Bounds Checking Lets Local Users Gain Root Privileges
Red Hat has released a fix for Red Hat Enterprise Linux IA64.
Jan 5 2004 (SuSE Issues Fix) Linux Kernel mremap() Improper Bounds Checking Lets Local Users Gain Root Privileges
SuSE has released a fix.
Jan 6 2004 (Immunix Issues Fix) Linux Kernel mremap() Improper Bounds Checking Lets Local Users Gain Root Privileges
Immunix has released a fix.
Jan 6 2004 (Turbolinux Issues Fix) Linux Kernel mremap() Improper Bounds Checking Lets Local Users Gain Root Privileges
Turbolinux has issued a fix.
Jan 6 2004 (Debian Issues Fix) Linux Kernel mremap() Improper Bounds Checking Lets Local Users Gain Root Privileges
Debian has released a fix.
Jan 7 2004 (Slackware Issues Fix) Linux Kernel mremap() Improper Bounds Checking Lets Local Users Gain Root Privileges
Slackware has released a fix.
Jan 7 2004 (Debian Issues Fix) Linux Kernel mremap() Improper Bounds Checking Lets Local Users Gain Root Privileges
Debian has released a fix for PowerPC and Alpha platforms.
Jan 8 2004 (Red Hat Issues Fix for RH Enterprise Linux) Linux Kernel mremap() Improper Bounds Checking Lets Local Users Gain Root Privileges
Red Hat has released a fix for Red Hat Enterprise Linux 3.
Jan 8 2004 (Mandrake Issues Fix) Linux Kernel mremap() Improper Bounds Checking Lets Local Users Gain Root Privileges
Mandrake has released a fix.
Jan 9 2004 (Slackware Issues Fix) Linux Kernel mremap() Improper Bounds Checking Lets Local Users Gain Root Privileges
Slackware has released a fix for Slackware 8.
Jan 9 2004 (Gentoo Issues Fix) Linux Kernel mremap() Improper Bounds Checking Lets Local Users Gain Root Privileges
Gentoo has released a fix.
Jan 9 2004 (Debian Issues Fix for Alpha) Linux Kernel mremap() Improper Bounds Checking Lets Local Users Gain Root Privileges
Debian has released a fix for the alpha architecture.
Jan 12 2004 (SmoothWall Issues Fix) Linux Kernel mremap() Improper Bounds Checking Lets Local Users Gain Root Privileges
A fix is available for SmoothWall Express.
Jan 15 2004 (Debian Issues Fix for IA64) Linux Kernel mremap() Improper Bounds Checking Lets Local Users Gain Root Privileges
Debian has released a fix for Debian Linux for the IA64 architecture.
Feb 17 2004 (Sun Issues Fix for Sun Linux) Linux Kernel mremap() Improper Bounds Checking Lets Local Users Gain Root Privileges
Sun has issued a fix for Sun Linux 5.0.
Feb 18 2004 (Debian Issues Fix) Linux Kernel mremap() Improper Bounds Checking Lets Local Users Gain Root Privileges
Debian has released a fix.
Feb 18 2004 (Debian Issues Fix for powerpc/apus) Linux Kernel mremap() Improper Bounds Checking Lets Local Users Gain Root Privileges
Debian has released a fix for the powerpc/apus architecture.
Feb 27 2004 (Debian Issues Fix for MIPS) Linux Kernel mremap() Improper Bounds Checking Lets Local Users Gain Root Privileges
Debian has released a fix for the mips architecture.
Mar 1 2004 (Exploit Code is Available) Linux Kernel mremap() Improper Bounds Checking Lets Local Users Gain Root Privileges
The author of the original advisory has released a detailed description of the vulnerability as well as some demonstration exploit code.
Apr 1 2004 (Debian Issues Fix for HPPA) Linux Kernel mremap() Improper Bounds Checking Lets Local Users Gain Root Privileges
Debian has released a fix for the hppa architecture.
Apr 2 2004 (VMware Issues Fix) Linux Kernel mremap() Improper Bounds Checking Lets Local Users Gain Root Privileges
VMware has issued a fix for ESX Server.
Apr 6 2004 (Debian Issues Fix for 2.4.18 HPPA) Linux Kernel mremap() Improper Bounds Checking Lets Local Users Gain Root Privileges
Debian has released a fix for the 2.4.18 kernel on the HPPA architecture.



 Source Message Contents

Subject:  [Full-Disclosure] Linux kernel mremap vulnerability


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Synopsis:  Linux kernel do_mremap local privilege escalation vulnerability
Product:   Linux kernel
Version:   2.2, 2.4 and 2.6 series
Vendor:    http://www.kernel.org/
URL:       http://isec.pl/vulnerabilities/isec-0012-mremap.txt
CVE:       http://cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2003-0985
Author:    Paul Starzetz <ihaquer@isec.pl>, Wojciech Purczynski
           <cliph@isec.pl>
Date:      January 5, 2004


Issue:
======

A critical security vulnerability has been found  in  the  Linux  kernel
memory  management  code in mremap(2) system call due to incorrect bound
checks.


Details:
========

The mremap system call provides functionality of resizing (shrinking  or
ing virtual memory areas (VMAs) or any of its parts.

A typical VMA covers at least one memory page (which is exactly  4kB  on
the  i386  architecture). An incorrect bound check discovered inside the
do_mremap() kernel code performing remapping of a  virtual  memory  area
may lead to creation of a virtual memory area of 0 bytes length.

The  problem  bases on the general mremap flaw that remapping of 2 pages
from inside a VMA creates a memory hole of only one page in  length  but
an  additional  VMA  of two pages. In the case of a zero sized remapping
request no VMA hole is created but an additional  VMA  descriptor  of  0
bytes in length is created.

Such  a malicious virtual memory area may disrupt the operation of other
expected behavior.

A  typical  process's  memory  layout  showing  invalid VMA created with
mremap system call:

    08048000-0804c000 r-xp 00000000 03:05 959142     /tmp/test
    0804c000-0804d000 rw-p 00003000 03:05 959142     /tmp/test
    0804d000-0804e000 rwxp 00000000 00:00 0
    40000000-40014000 r-xp 00000000 03:05 1544523    /lib/ld-2.3.2.so
    40014000-40015000 rw-p 00013000 03:05 1544523    /lib/ld-2.3.2.so
    40015000-40016000 rw-p 00000000 00:00 0
    4002c000-40158000 r-xp 00000000 03:05 1544529    /lib/libc.so.6
    40158000-4015d000 rw-p 0012b000 03:05 1544529    /lib/libc.so.6
    4015d000-4015f000 rw-p 00000000 00:00 0
[*] 60000000-60000000 rwxp 00000000 00:00 0
    bfffe000-c0000000 rwxp fffff000 00:00 0

The broken VMA in the above example has been marked with a [*].


Impact:
=======

Since  no  special  privileges  are required to use the mremap(2) system
trary  code  with kernel level access. Proof-of-concept exploit code has
been created and successfully tested giving UID 0  shell  on  vulnerable
systems.

The exploitability of the discovered vulnerability is possible, although
tors  for  the  2.4 kernel series. All users are encouraged to patch all
vulnerable systems as soon as appropriate vendor patches are released.


Credits:
========

Paul Starzetz <ihaquer@isec.pl> has  identified  the  vulnerability  and
performed  further  research. COPYING, DISTRIBUTION, AND MODIFICATION OF
INFORMATION PRESENTED HERE IS ALLOWED ONLY WITH  EXPRESS  PERMISSION  OF
ONE OF THE AUTHORS.


Disclaimer:
===========

This  document and all the information it contains are provided "as is",
press or implied.

The  authors reserve the right not to be responsible for the topicality,
correctness, completeness or quality of  the  information   provided  in
this  document.  Liability  claims regarding damage caused by the use of
complete or incorrect, will therefore be rejected.

- -- 
Paul Starzetz
iSEC Security Research
http://isec.pl/

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE/+Vj2C+8U3Z5wpu4RApegAKCOkWCWg8Jy/y9S1WtEWxerkkQNbQCgk/X9
8aGjOA7fTT8EynIFw/sgoHU=
=Aw61
-----END PGP SIGNATURE-----


_______________________________________________
Full-Disclosure - We believe in it.
Charter: http://lists.netsys.com/full-disclosure-charter.html

 
 


Go to the Top of This SecurityTracker Archive Page





Home   |    View Topics   |    Search   |    Contact Us

This web site uses cookies for web analytics. Learn More

Copyright 2021, SecurityGlobal.net LLC