Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[ GLSA 200403-02 ] Linux kernel do_mremap local privilege escalation vulnerability
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index News & Announcements
View previous topic :: View next topic  
Author Message
GLSA
Bodhisattva
Bodhisattva


Joined: 13 Jun 2003
Posts: 4087
Location: Dresden, Germany

PostPosted: Sat Mar 06, 2004 11:51 pm    Post subject: [ GLSA 200403-02 ] Linux kernel do_mremap local privilege es Reply with quote

Gentoo Linux Security Advisory

Title: Linux kernel do_mremap local privilege escalation vulnerability (GLSA 200403-02)
Severity: high
Exploitable: local
Date: March 05, 2004
Updated: May 22, 2006
Bug(s): #42024
ID: 200403-02

Synopsis

A critical security vulnerability has been found in recent Linux kernels by Paul Starzetz of iSEC Security Research which allows for local privilege escalations.

Background

The Linux kernel is responsible for memory management in a working system - to allow this, processes are allowed to allocate and unallocate memory.

Affected Packages

Package: sys-kernel/aa-sources
Vulnerable: < 2.4.23-r1
Unaffected: >= 2.4.23-r1
Architectures: All supported architectures

Package: sys-kernel/alpha-sources
Vulnerable: < 2.4.21-r4
Unaffected: >= 2.4.21-r4
Architectures: All supported architectures

Package: sys-kernel/ck-sources
Vulnerable: < 2.6.2-r1
Unaffected: = 2.4.24-r1
Unaffected: >= 2.6.2-r1
Architectures: All supported architectures

Package: sys-kernel/compaq-sources
Vulnerable: < 2.4.9.32.7-r2
Unaffected: >= 2.4.9.32.7-r2
Architectures: All supported architectures

Package: sys-kernel/development-sources
Vulnerable: < 2.6.3_rc1
Unaffected: >= 2.6.3_rc1
Architectures: All supported architectures

Package: sys-kernel/gaming-sources
Vulnerable: < 2.4.20-r8
Unaffected: >= 2.4.20-r8
Architectures: All supported architectures

Package: sys-kernel/gentoo-dev-sources
Vulnerable: < 2.6.3_rc1
Unaffected: >= 2.6.3_rc1
Architectures: All supported architectures

Package: sys-kernel/gentoo-sources
Vulnerable: < 2.4.22-r7
Unaffected: = 2.4.19-r11
Unaffected: = 2.4.20-r12
Unaffected: >= 2.4.22-r7
Architectures: All supported architectures

Package: sys-kernel/grsec-sources
Vulnerable: < 2.4.24.1.9.13-r1
Unaffected: >= 2.4.24.1.9.13-r1
Architectures: All supported architectures

Package: sys-kernel/gs-sources
Vulnerable: < 2.4.25_pre7-r2
Unaffected: >= 2.4.25_pre7-r2
Architectures: All supported architectures

Package: sys-kernel/hardened-sources
Vulnerable: < 2.4.24-r1
Unaffected: >= 2.4.24-r1
Architectures: All supported architectures

Package: sys-kernel/hppa-dev-sources
Vulnerable: < 2.6.2_p3-r1
Unaffected: >= 2.6.2_p3-r1
Architectures: All supported architectures

Package: sys-kernel/hppa-sources
Vulnerable: < 2.4.24_p0-r1
Unaffected: >= 2.4.24_p0-r1
Architectures: All supported architectures

Package: sys-kernel/ia64-sources
Vulnerable: < 2.4.24-r1
Unaffected: >= 2.4.24-r1
Architectures: All supported architectures

Package: sys-kernel/mips-prepatch-sources
Vulnerable: < 2.4.25_pre6-r1
Unaffected: >= 2.4.25_pre6-r1
Architectures: All supported architectures

Package: sys-kernel/mips-sources
Vulnerable: < 2.4.25_rc4
Unaffected: >= 2.4.25_rc4
Architectures: All supported architectures

Package: sys-kernel/mm-sources
Vulnerable: < 2.6.3_rc1-r1
Unaffected: >= 2.6.3_rc1-r1
Architectures: All supported architectures

Package: sys-kernel/openmosix-sources
Vulnerable: < 2.4.22-r4
Unaffected: >= 2.4.22-r4
Architectures: All supported architectures

Package: sys-kernel/pac-sources
Vulnerable: < 2.4.23-r3
Unaffected: >= 2.4.23-r3
Architectures: All supported architectures

Package: sys-kernel/planet-ccrma-sources
Vulnerable: < 2.4.21-r5
Unaffected: >= 2.4.21-r5
Architectures: All supported architectures

Package: sys-kernel/ppc-development-sources
Vulnerable: < 2.6.3_rc1-r1
Unaffected: >= 2.6.3_rc1-r1
Architectures: All supported architectures

Package: sys-kernel/ppc-sources
Vulnerable: < 2.4.24-r1
Unaffected: >= 2.4.24-r1
Architectures: All supported architectures

Package: sys-kernel/ppc-sources-benh
Vulnerable: < 2.4.22-r5
Unaffected: >= 2.4.22-r5
Architectures: All supported architectures

Package: sys-kernel/ppc-sources-crypto
Vulnerable: < 2.4.20-r3
Unaffected: >= 2.4.20-r3
Architectures: All supported architectures

Package: sys-kernel/ppc-sources-dev
Vulnerable: < 2.4.24-r2
Unaffected: >= 2.4.24-r2
Architectures: All supported architectures

Package: sys-kernel/selinux-sources
Vulnerable: < 2.4.24-r2
Unaffected: >= 2.4.24-r2
Architectures: All supported architectures

Package: sys-kernel/sparc-dev-sources
Vulnerable: < 2.6.3_rc1
Unaffected: >= 2.6.3_rc1
Architectures: All supported architectures

Package: sys-kernel/sparc-sources
Vulnerable: < 2.4.24-r2
Unaffected: >= 2.4.24-r2
Architectures: All supported architectures

Package: sys-kernel/usermode-sources
Vulnerable: < 2.6.3-r1
Unaffected: >= 2.4.24-r1 < 2.4.25
Unaffected: >= 2.4.26 < 2.4.27
Unaffected: >= 2.6.3-r1
Architectures: All supported architectures

Package: sys-kernel/vanilla-prepatch-sources
Vulnerable: < 2.4.25_rc4
Unaffected: >= 2.4.25_rc4
Architectures: All supported architectures

Package: sys-kernel/vanilla-sources
Vulnerable: < 2.4.25
Unaffected: >= 2.4.25
Architectures: All supported architectures

Package: sys-kernel/win4lin-sources
Vulnerable: < 2.6.2-r1
Unaffected: = 2.4.23-r2
Unaffected: >= 2.6.2-r1
Architectures: All supported architectures

Package: sys-kernel/wolk-sources
Vulnerable: < 4.10_pre7-r3
Unaffected: = 4.9-r4
Unaffected: >= 4.10_pre7-r3
Architectures: All supported architectures

Package: sys-kernel/xfs-sources
Vulnerable: < 2.4.24-r2
Unaffected: >= 2.4.24-r2
Architectures: All supported architectures


Description

The memory subsystem allows for shrinking, growing, and moving of chunks of memory along any of the allocated memory areas which the kernel posesses. To accomplish this, the do_mremap code calls the do_munmap() kernel function to remove any old memory mappings in the new location - but, the code doesn't check the return value of the do_munmap() function which may fail if the maximum number of available virtual memory area descriptors has been exceeded. Due to the missing return value check after trying to unmap the middle of the first memory area, the corresponding page table entries from the second new area are inserted into the page table locations described by the first old one, thus they are subject to page protection flags of the first area. As a result, arbitrary code can be executed.

Impact

Arbitrary code with normal non-super-user privelerges may be able to exploit this vulnerability and may disrupt the operation of other parts of the kernel memory management subroutines finally leading to unexpected behavior. Since no special privileges are required to use the mremap() and mummap() system calls any process may misuse this unexpected behavior to disrupt the kernel memory management subsystem. Proper exploitation of this vulnerability may lead to local privilege escalation allowing for the execution of arbitrary code with kernel level root access. Proof-of-concept exploit code has been created and successfully tested, permitting root escalation on vulnerable systems. As a result, all users should upgrade their kernels to new or patched versions.

Workaround

Users who are unable to upgrade their kernels may attempt to use "sysctl -w vm.max_map_count=1000000", however, this is a temporary fix which only solves the problem by increasing the number of memory areas that can be created by each process. Because of the static nature of this workaround, it is not recommended and users are urged to upgrade their systems to the latest avaiable patched sources.

Resolution

Users are encouraged to upgrade to the latest available sources for their system:
Code:
# emerge sync
# emerge -pv your-favourite-sources
# emerge your-favourite-sources
# # Follow usual procedure for compiling and installing a kernel.
# # If you use genkernel, run genkernel as you would do normally.
# # IF YOUR KERNEL IS MARKED as "remerge required!" THEN
# # YOU SHOULD UPDATE YOUR KERNEL EVEN IF PORTAGE
# # REPORTS THAT THE SAME VERSION IS INSTALLED.


References

Advisory released by iSEC
CVE-2004-0077


Last edited by GLSA on Tue May 23, 2006 4:16 am; edited 2 times in total
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index News & Announcements All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum