1 |
-----BEGIN PGP SIGNED MESSAGE----- |
2 |
Hash: SHA1 |
3 |
|
4 |
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
5 |
Gentoo Linux Security Advisory GLSA 200403-02 |
6 |
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
7 |
~ http://security.gentoo.org |
8 |
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
9 |
|
10 |
~ Severity: High |
11 |
~ Title: Linux kernel do_mremap local privilege escalation |
12 |
~ vulnerability |
13 |
~ Date: March 06, 2004 |
14 |
~ Bugs: #42024 |
15 |
~ ID: 200403-02 |
16 |
|
17 |
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
18 |
|
19 |
Synopsis |
20 |
======== |
21 |
|
22 |
A critical security vulnerability has been found in recent Linux |
23 |
kernels by Paul Starzetz of iSEC Security Research which allows for |
24 |
local privilege escalations. |
25 |
|
26 |
Background |
27 |
========== |
28 |
|
29 |
The Linux kernel is responsible for memory management in a working |
30 |
system - to allow this, processes are allowed to allocate and |
31 |
unallocate memory. |
32 |
|
33 |
Affected packages |
34 |
================= |
35 |
|
36 |
~ ------------------------------------------------------------------- |
37 |
~ Kernel / Unaffected Version / Manual Update? |
38 |
~ ------------------------------------------------------------------- |
39 |
|
40 |
~ aa-sources................2.4.23-r1...................YES.......... |
41 |
~ alpha-sources.............2.4.21-r4................................ |
42 |
~ ck-sources................2.4.24-r1...................YES.......... |
43 |
~ ck-sources................2.6.2-r1....................YES.......... |
44 |
~ compaq-sources............2.4.9.32.7-r2............................ |
45 |
~ development-sources.......2.6.3_rc1................................ |
46 |
~ gaming-sources............2.4.20-r8................................ |
47 |
~ gentoo-dev-sources........2.6.3_rc1................................ |
48 |
~ gentoo-sources............2.4.19-r11............................... |
49 |
~ gentoo-sources............2.4.20-r12............................... |
50 |
~ gentoo-sources............2.4.22-r7................................ |
51 |
~ grsec-sources.............2.4.24.1.9.13-r1......................... |
52 |
~ gs-sources................2.4.25_pre7-r2........................... |
53 |
~ hardened-sources..........2.4.24-r1................................ |
54 |
~ hppa-dev-sources..........2.6.2_p3-r1.............................. |
55 |
~ hppa-sources..............2.4.24_p0-r1............................. |
56 |
~ ia64-sources..............2.4.24-r1................................ |
57 |
~ mips-prepatch-sources.....2.4.25_pre6-r1........................... |
58 |
~ mips-sources..............2.4.25_rc4............................... |
59 |
~ mm-sources................2.6.3_rc1-r1............................. |
60 |
~ openmosix-sources.........2.4.22-r4................................ |
61 |
~ pac-sources...............2.4.23-r3................................ |
62 |
~ planet-ccrma-sources......2.4.21-r5................................ |
63 |
~ ppc-development-sources...2.6.3_rc1-r1............................. |
64 |
~ ppc-sources...............2.4.24-r1................................ |
65 |
~ ppc-sources-benh..........2.4.22-r5................................ |
66 |
~ ppc-sources-crypto........2.4.20-r3................................ |
67 |
~ ppc-sources-dev...........2.4.24-r2................................ |
68 |
~ selinux-sources...........2.4.24-r2................................ |
69 |
~ sparc-dev-sources.........2.6.3_rc1................................ |
70 |
~ sparc-sources.............2.4.24-r2................................ |
71 |
~ usermode-sources..........2.4.24-r1................................ |
72 |
~ usermode-sources..........2.6.3-r1................................. |
73 |
~ vanilla-prepatch-sources..2.4.25_rc4............................... |
74 |
~ vanilla-sources...........2.4.25................................... |
75 |
~ win4lin-sources...........2.4.23-r2................................ |
76 |
~ win4lin-sources...........2.6.2-r1................................. |
77 |
~ wolk-sources..............4.9-r4................................... |
78 |
~ wolk-sources..............4.10_pre7-r3............................. |
79 |
~ xfs-sources...............2.4.24-r2................................ |
80 |
|
81 |
~ IMPORTANT: IF YOUR KERNEL IS MARKED AS "YES" ABOVE, THEN YOU SHOULD |
82 |
~ UPDATE YOUR KERNEL EVEN IF PORTAGE REPORTS THAT THE SAME |
83 |
~ VERSION IS INSTALLED. |
84 |
|
85 |
Description |
86 |
=========== |
87 |
|
88 |
The memory subsystem allows for shrinking, growing, and moving of |
89 |
chunks of memory along any of the allocated memory areas which the |
90 |
kernel posesses. |
91 |
|
92 |
To accomplish this, the do_mremap code calls the do_munmap() kernel |
93 |
function to remove any old memory mappings in the new location - but, |
94 |
the code doesn't check the return value of the do_munmap() function |
95 |
which may fail if the maximum number of available virtual memory area |
96 |
descriptors has been exceeded. |
97 |
|
98 |
Due to the missing return value check after trying to unmap the middle |
99 |
of the first memory area, the corresponding page table entries from |
100 |
the second new area are inserted into the page table locations |
101 |
described by the first old one, thus they are subject to page |
102 |
protection flags of the first area. As a result, arbitrary code can be |
103 |
executed. |
104 |
|
105 |
Impact |
106 |
====== |
107 |
|
108 |
Arbitrary code with normal non-superuser privelerges may be able to |
109 |
exploit this vulnerability and may disrupt the operation of other |
110 |
parts of the kernel memory management subroutines finally leading to |
111 |
unexpected behavior. |
112 |
|
113 |
Since no special privileges are required to use the mremap() and |
114 |
mummap() system calls any process may misuse this unexpected behavior |
115 |
to disrupt the kernel memory management subsystem. Proper exploitation |
116 |
of this vulnerability may lead to local privilege escalation allowing |
117 |
for the execution of arbitrary code with kernel level root access. |
118 |
|
119 |
Proof-of-concept exploit code has been created and successfully |
120 |
tested, permitting root escalation on vulnerable systems. As a result, |
121 |
all users should upgrade their kernels to new or patched versions. |
122 |
|
123 |
Workaround |
124 |
========== |
125 |
|
126 |
Users who are unable to upgrade their kernels may attempt to use "sysctl |
127 |
- -w vm.max_map_count=1000000", however, this is a temporary fix which |
128 |
only solves the problem by increasing the number of memory areas that |
129 |
can be created by each process. Because of the static nature of this |
130 |
workaround, it is not recommended and users are urged to upgrade their |
131 |
systems to the latest avaiable patched sources. |
132 |
|
133 |
Resolution |
134 |
========== |
135 |
|
136 |
Users are encouraged to upgrade to the latest available sources for |
137 |
their system: |
138 |
|
139 |
~ # emerge sync |
140 |
~ # emerge -pv your-favourite-sources |
141 |
~ # emerge your-favourite-sources |
142 |
~ # # Follow usual procedure for compiling and installing a kernel. |
143 |
~ # # If you use genkernel, run genkernel as you would do normally. |
144 |
|
145 |
~ # # IF YOUR KERNEL IS MARKED as "remerge required!" THEN |
146 |
~ # # YOU SHOULD UPDATE YOUR KERNEL EVEN IF PORTAGE |
147 |
~ # # REPORTS THAT THE SAME VERSION IS INSTALLED. |
148 |
|
149 |
References |
150 |
========== |
151 |
|
152 |
~ [ 1 ] http://isec.pl/vulnerabilities/isec-0014-mremap-unmap.txt |
153 |
|
154 |
Concerns? |
155 |
========= |
156 |
|
157 |
Security is a primary focus of Gentoo Linux and ensuring the |
158 |
confidentiality and security of our users machines is of utmost |
159 |
importance to us. Any security concerns should be addressed to |
160 |
security@g.o or alternatively, you may file a bug at |
161 |
http://bugs.gentoo.org. |
162 |
|
163 |
-----BEGIN PGP SIGNATURE----- |
164 |
Version: GnuPG v1.2.4 (GNU/Linux) |
165 |
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org |
166 |
|
167 |
iD8DBQFASmFiMMXbAy2b2EIRAoCaAKCv7sK0dcnWWlOmt99O46UAYgH4JgCguJqP |
168 |
aUwuRGQXe2983x90mRNAg1k= |
169 |
=HqO0 |
170 |
-----END PGP SIGNATURE----- |