1 |
commit: 6772694beda827666e7c091e6208fbe9a83114e5 |
2 |
Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Feb 1 00:47:46 2013 +0000 |
4 |
Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Feb 1 00:47:46 2013 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/hardened-patchset.git;a=commit;h=6772694b |
7 |
|
8 |
Grsec/PaX: 2.9.1-{2.6.32.60,3.2.37,3.7.5}-201301311811 |
9 |
|
10 |
--- |
11 |
2.6.32/0000_README | 2 +- |
12 |
..._grsecurity-2.9.1-2.6.32.60-201301311809.patch} | 62 ++++++++++++++----- |
13 |
3.2.37/0000_README | 2 +- |
14 |
...420_grsecurity-2.9.1-3.2.37-201301311810.patch} | 62 ++++++++++++++----- |
15 |
3.7.5/0000_README | 2 +- |
16 |
...4420_grsecurity-2.9.1-3.7.5-201301311811.patch} | 62 ++++++++++++++----- |
17 |
6 files changed, 138 insertions(+), 54 deletions(-) |
18 |
|
19 |
diff --git a/2.6.32/0000_README b/2.6.32/0000_README |
20 |
index 584dc17..ff482d8 100644 |
21 |
--- a/2.6.32/0000_README |
22 |
+++ b/2.6.32/0000_README |
23 |
@@ -34,7 +34,7 @@ Patch: 1059_linux-2.6.32.60.patch |
24 |
From: http://www.kernel.org |
25 |
Desc: Linux 2.6.32.59 |
26 |
|
27 |
-Patch: 4420_grsecurity-2.9.1-2.6.32.60-201301281956.patch |
28 |
+Patch: 4420_grsecurity-2.9.1-2.6.32.60-201301311809.patch |
29 |
From: http://www.grsecurity.net |
30 |
Desc: hardened-sources base patch from upstream grsecurity |
31 |
|
32 |
|
33 |
diff --git a/2.6.32/4420_grsecurity-2.9.1-2.6.32.60-201301281956.patch b/2.6.32/4420_grsecurity-2.9.1-2.6.32.60-201301311809.patch |
34 |
similarity index 99% |
35 |
rename from 2.6.32/4420_grsecurity-2.9.1-2.6.32.60-201301281956.patch |
36 |
rename to 2.6.32/4420_grsecurity-2.9.1-2.6.32.60-201301311809.patch |
37 |
index dd6c22f..c356f5e 100644 |
38 |
--- a/2.6.32/4420_grsecurity-2.9.1-2.6.32.60-201301281956.patch |
39 |
+++ b/2.6.32/4420_grsecurity-2.9.1-2.6.32.60-201301311809.patch |
40 |
@@ -8816,7 +8816,7 @@ index d1b93c4..ae1b7fd 100644 |
41 |
void default_idle(void); |
42 |
|
43 |
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig |
44 |
-index aa889d6..1468e63 100644 |
45 |
+index aa889d6..883686f 100644 |
46 |
--- a/arch/x86/Kconfig |
47 |
+++ b/arch/x86/Kconfig |
48 |
@@ -223,7 +223,7 @@ config X86_TRAMPOLINE |
49 |
@@ -8828,7 +8828,15 @@ index aa889d6..1468e63 100644 |
50 |
|
51 |
config KTIME_SCALAR |
52 |
def_bool X86_32 |
53 |
-@@ -1008,7 +1008,7 @@ choice |
54 |
+@@ -985,6 +985,7 @@ config MICROCODE_OLD_INTERFACE |
55 |
+ |
56 |
+ config X86_MSR |
57 |
+ tristate "/dev/cpu/*/msr - Model-specific register support" |
58 |
++ depends on !GRKERNSEC_KMEM |
59 |
+ ---help--- |
60 |
+ This device gives privileged processes access to the x86 |
61 |
+ Model-Specific Registers (MSRs). It is a character device with |
62 |
+@@ -1008,7 +1009,7 @@ choice |
63 |
|
64 |
config NOHIGHMEM |
65 |
bool "off" |
66 |
@@ -8837,7 +8845,7 @@ index aa889d6..1468e63 100644 |
67 |
---help--- |
68 |
Linux can use up to 64 Gigabytes of physical memory on x86 systems. |
69 |
However, the address space of 32-bit x86 processors is only 4 |
70 |
-@@ -1045,7 +1045,7 @@ config NOHIGHMEM |
71 |
+@@ -1045,7 +1046,7 @@ config NOHIGHMEM |
72 |
|
73 |
config HIGHMEM4G |
74 |
bool "4GB" |
75 |
@@ -8846,7 +8854,7 @@ index aa889d6..1468e63 100644 |
76 |
---help--- |
77 |
Select this if you have a 32-bit processor and between 1 and 4 |
78 |
gigabytes of physical RAM. |
79 |
-@@ -1099,7 +1099,7 @@ config PAGE_OFFSET |
80 |
+@@ -1099,7 +1100,7 @@ config PAGE_OFFSET |
81 |
hex |
82 |
default 0xB0000000 if VMSPLIT_3G_OPT |
83 |
default 0x80000000 if VMSPLIT_2G |
84 |
@@ -8855,7 +8863,7 @@ index aa889d6..1468e63 100644 |
85 |
default 0x40000000 if VMSPLIT_1G |
86 |
default 0xC0000000 |
87 |
depends on X86_32 |
88 |
-@@ -1469,6 +1469,7 @@ config SECCOMP |
89 |
+@@ -1469,6 +1470,7 @@ config SECCOMP |
90 |
|
91 |
config CC_STACKPROTECTOR |
92 |
bool "Enable -fstack-protector buffer overflow detection (EXPERIMENTAL)" |
93 |
@@ -8863,7 +8871,7 @@ index aa889d6..1468e63 100644 |
94 |
---help--- |
95 |
This option turns on the -fstack-protector GCC feature. This |
96 |
feature puts, at the beginning of functions, a canary value on |
97 |
-@@ -1526,6 +1527,7 @@ config KEXEC_JUMP |
98 |
+@@ -1526,6 +1528,7 @@ config KEXEC_JUMP |
99 |
config PHYSICAL_START |
100 |
hex "Physical address where the kernel is loaded" if (EMBEDDED || CRASH_DUMP) |
101 |
default "0x1000000" |
102 |
@@ -8871,7 +8879,7 @@ index aa889d6..1468e63 100644 |
103 |
---help--- |
104 |
This gives the physical address where the kernel is loaded. |
105 |
|
106 |
-@@ -1590,6 +1592,7 @@ config PHYSICAL_ALIGN |
107 |
+@@ -1590,6 +1593,7 @@ config PHYSICAL_ALIGN |
108 |
hex |
109 |
prompt "Alignment value to which kernel should be aligned" if X86_32 |
110 |
default "0x1000000" |
111 |
@@ -8879,7 +8887,7 @@ index aa889d6..1468e63 100644 |
112 |
range 0x2000 0x1000000 |
113 |
---help--- |
114 |
This value puts the alignment restrictions on physical address |
115 |
-@@ -1621,9 +1624,10 @@ config HOTPLUG_CPU |
116 |
+@@ -1621,9 +1625,10 @@ config HOTPLUG_CPU |
117 |
Say N if you want to disable CPU hotplug. |
118 |
|
119 |
config COMPAT_VDSO |
120 |
@@ -20876,6 +20884,20 @@ index 3b7078a..7367929 100644 |
121 |
+ *(void **)&x86_init.resources.probe_roms = x86_init_noop; |
122 |
+ *(void **)&x86_init.resources.reserve_resources = x86_init_noop; |
123 |
} |
124 |
+diff --git a/arch/x86/kernel/msr.c b/arch/x86/kernel/msr.c |
125 |
+index 5eaeb5e..63a053b 100644 |
126 |
+--- a/arch/x86/kernel/msr.c |
127 |
++++ b/arch/x86/kernel/msr.c |
128 |
+@@ -176,6 +176,9 @@ static int msr_open(struct inode *inode, struct file *file) |
129 |
+ struct cpuinfo_x86 *c = &cpu_data(cpu); |
130 |
+ int ret = 0; |
131 |
+ |
132 |
++ if (!capable(CAP_SYS_RAWIO)) |
133 |
++ return -EPERM; |
134 |
++ |
135 |
+ lock_kernel(); |
136 |
+ cpu = iminor(file->f_path.dentry->d_inode); |
137 |
+ |
138 |
diff --git a/arch/x86/kernel/paravirt-spinlocks.c b/arch/x86/kernel/paravirt-spinlocks.c |
139 |
index 3a7c5a4..9191528 100644 |
140 |
--- a/arch/x86/kernel/paravirt-spinlocks.c |
141 |
@@ -84661,10 +84683,10 @@ index e89734e..5e84d8d 100644 |
142 |
return 0; |
143 |
diff --git a/grsecurity/Kconfig b/grsecurity/Kconfig |
144 |
new file mode 100644 |
145 |
-index 0000000..5e175a6 |
146 |
+index 0000000..23e4fc1 |
147 |
--- /dev/null |
148 |
+++ b/grsecurity/Kconfig |
149 |
-@@ -0,0 +1,997 @@ |
150 |
+@@ -0,0 +1,1003 @@ |
151 |
+# |
152 |
+# grecurity configuration |
153 |
+# |
154 |
@@ -84678,18 +84700,24 @@ index 0000000..5e175a6 |
155 |
+ help |
156 |
+ If you say Y here, /dev/kmem and /dev/mem won't be allowed to |
157 |
+ be written to or read from to modify or leak the contents of the running |
158 |
-+ kernel. /dev/port will also not be allowed to be opened. If you have module |
159 |
-+ support disabled, enabling this will close up four ways that are |
160 |
++ kernel. /dev/port will also not be allowed to be opened and support |
161 |
++ for /dev/cpu/*/msr will be removed. If you have module |
162 |
++ support disabled, enabling this will close up five ways that are |
163 |
+ currently used to insert malicious code into the running kernel. |
164 |
++ |
165 |
+ Even with all these features enabled, we still highly recommend that |
166 |
+ you use the RBAC system, as it is still possible for an attacker to |
167 |
+ modify the running kernel through privileged I/O granted by ioperm/iopl. |
168 |
++ |
169 |
+ If you are not using XFree86, you may be able to stop this additional |
170 |
+ case by enabling the 'Disable privileged I/O' option. Though nothing |
171 |
+ legitimately writes to /dev/kmem, XFree86 does need to write to /dev/mem, |
172 |
+ but only to video memory, which is the only writing we allow in this |
173 |
+ case. If /dev/kmem or /dev/mem are mmaped without PROT_WRITE, they will |
174 |
+ not be allowed to mprotect it with PROT_WRITE later. |
175 |
++ Enabling this feature will prevent the "cpupower" and "powertop" tools |
176 |
++ from working. |
177 |
++ |
178 |
+ It is highly recommended that you say Y here if you meet all the |
179 |
+ conditions above. |
180 |
+ |
181 |
@@ -85212,11 +85240,11 @@ index 0000000..5e175a6 |
182 |
+config GRKERNSEC_AUDIT_GROUP |
183 |
+ bool "Single group for auditing" |
184 |
+ help |
185 |
-+ If you say Y here, the exec, chdir, and (un)mount logging features |
186 |
-+ will only operate on a group you specify. This option is recommended |
187 |
-+ if you only want to watch certain users instead of having a large |
188 |
-+ amount of logs from the entire system. If the sysctl option is enabled, |
189 |
-+ a sysctl option with name "audit_group" is created. |
190 |
++ If you say Y here, the exec and chdir logging features will only operate |
191 |
++ on a group you specify. This option is recommended if you only want to |
192 |
++ watch certain users instead of having a large amount of logs from the |
193 |
++ entire system. If the sysctl option is enabled, a sysctl option with |
194 |
++ name "audit_group" is created. |
195 |
+ |
196 |
+config GRKERNSEC_AUDIT_GID |
197 |
+ int "GID for auditing" |
198 |
|
199 |
diff --git a/3.2.37/0000_README b/3.2.37/0000_README |
200 |
index f61fd16..4390092 100644 |
201 |
--- a/3.2.37/0000_README |
202 |
+++ b/3.2.37/0000_README |
203 |
@@ -66,7 +66,7 @@ Patch: 1036_linux-3.2.37.patch |
204 |
From: http://www.kernel.org |
205 |
Desc: Linux 3.2.37 |
206 |
|
207 |
-Patch: 4420_grsecurity-2.9.1-3.2.37-201301281956.patch |
208 |
+Patch: 4420_grsecurity-2.9.1-3.2.37-201301311810.patch |
209 |
From: http://www.grsecurity.net |
210 |
Desc: hardened-sources base patch from upstream grsecurity |
211 |
|
212 |
|
213 |
diff --git a/3.2.37/4420_grsecurity-2.9.1-3.2.37-201301281956.patch b/3.2.37/4420_grsecurity-2.9.1-3.2.37-201301311810.patch |
214 |
similarity index 99% |
215 |
rename from 3.2.37/4420_grsecurity-2.9.1-3.2.37-201301281956.patch |
216 |
rename to 3.2.37/4420_grsecurity-2.9.1-3.2.37-201301311810.patch |
217 |
index c2ee615..aba5725 100644 |
218 |
--- a/3.2.37/4420_grsecurity-2.9.1-3.2.37-201301281956.patch |
219 |
+++ b/3.2.37/4420_grsecurity-2.9.1-3.2.37-201301311810.patch |
220 |
@@ -8010,7 +8010,7 @@ index ad8f795..2c7eec6 100644 |
221 |
/* |
222 |
* Memory returned by kmalloc() may be used for DMA, so we must make |
223 |
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig |
224 |
-index efb4294..61bc18c 100644 |
225 |
+index efb4294..9e31255 100644 |
226 |
--- a/arch/x86/Kconfig |
227 |
+++ b/arch/x86/Kconfig |
228 |
@@ -235,7 +235,7 @@ config X86_HT |
229 |
@@ -8022,7 +8022,15 @@ index efb4294..61bc18c 100644 |
230 |
|
231 |
config ARCH_HWEIGHT_CFLAGS |
232 |
string |
233 |
-@@ -1022,7 +1022,7 @@ choice |
234 |
+@@ -999,6 +999,7 @@ config MICROCODE_OLD_INTERFACE |
235 |
+ |
236 |
+ config X86_MSR |
237 |
+ tristate "/dev/cpu/*/msr - Model-specific register support" |
238 |
++ depends on !GRKERNSEC_KMEM |
239 |
+ ---help--- |
240 |
+ This device gives privileged processes access to the x86 |
241 |
+ Model-Specific Registers (MSRs). It is a character device with |
242 |
+@@ -1022,7 +1023,7 @@ choice |
243 |
|
244 |
config NOHIGHMEM |
245 |
bool "off" |
246 |
@@ -8031,7 +8039,7 @@ index efb4294..61bc18c 100644 |
247 |
---help--- |
248 |
Linux can use up to 64 Gigabytes of physical memory on x86 systems. |
249 |
However, the address space of 32-bit x86 processors is only 4 |
250 |
-@@ -1059,7 +1059,7 @@ config NOHIGHMEM |
251 |
+@@ -1059,7 +1060,7 @@ config NOHIGHMEM |
252 |
|
253 |
config HIGHMEM4G |
254 |
bool "4GB" |
255 |
@@ -8040,7 +8048,7 @@ index efb4294..61bc18c 100644 |
256 |
---help--- |
257 |
Select this if you have a 32-bit processor and between 1 and 4 |
258 |
gigabytes of physical RAM. |
259 |
-@@ -1113,7 +1113,7 @@ config PAGE_OFFSET |
260 |
+@@ -1113,7 +1114,7 @@ config PAGE_OFFSET |
261 |
hex |
262 |
default 0xB0000000 if VMSPLIT_3G_OPT |
263 |
default 0x80000000 if VMSPLIT_2G |
264 |
@@ -8049,7 +8057,7 @@ index efb4294..61bc18c 100644 |
265 |
default 0x40000000 if VMSPLIT_1G |
266 |
default 0xC0000000 |
267 |
depends on X86_32 |
268 |
-@@ -1496,6 +1496,7 @@ config SECCOMP |
269 |
+@@ -1496,6 +1497,7 @@ config SECCOMP |
270 |
|
271 |
config CC_STACKPROTECTOR |
272 |
bool "Enable -fstack-protector buffer overflow detection (EXPERIMENTAL)" |
273 |
@@ -8057,7 +8065,7 @@ index efb4294..61bc18c 100644 |
274 |
---help--- |
275 |
This option turns on the -fstack-protector GCC feature. This |
276 |
feature puts, at the beginning of functions, a canary value on |
277 |
-@@ -1553,6 +1554,7 @@ config KEXEC_JUMP |
278 |
+@@ -1553,6 +1555,7 @@ config KEXEC_JUMP |
279 |
config PHYSICAL_START |
280 |
hex "Physical address where the kernel is loaded" if (EXPERT || CRASH_DUMP) |
281 |
default "0x1000000" |
282 |
@@ -8065,7 +8073,7 @@ index efb4294..61bc18c 100644 |
283 |
---help--- |
284 |
This gives the physical address where the kernel is loaded. |
285 |
|
286 |
-@@ -1616,6 +1618,7 @@ config X86_NEED_RELOCS |
287 |
+@@ -1616,6 +1619,7 @@ config X86_NEED_RELOCS |
288 |
config PHYSICAL_ALIGN |
289 |
hex "Alignment value to which kernel should be aligned" if X86_32 |
290 |
default "0x1000000" |
291 |
@@ -8073,7 +8081,7 @@ index efb4294..61bc18c 100644 |
292 |
range 0x2000 0x1000000 |
293 |
---help--- |
294 |
This value puts the alignment restrictions on physical address |
295 |
-@@ -1647,9 +1650,10 @@ config HOTPLUG_CPU |
296 |
+@@ -1647,9 +1651,10 @@ config HOTPLUG_CPU |
297 |
Say N if you want to disable CPU hotplug. |
298 |
|
299 |
config COMPAT_VDSO |
300 |
@@ -18876,6 +18884,20 @@ index 925179f..59bfaa1 100644 |
301 |
#if 0 |
302 |
if ((s64)val != *(s32 *)loc) |
303 |
goto overflow; |
304 |
+diff --git a/arch/x86/kernel/msr.c b/arch/x86/kernel/msr.c |
305 |
+index 12fcbe2..f7d1a64 100644 |
306 |
+--- a/arch/x86/kernel/msr.c |
307 |
++++ b/arch/x86/kernel/msr.c |
308 |
+@@ -175,6 +175,9 @@ static int msr_open(struct inode *inode, struct file *file) |
309 |
+ unsigned int cpu; |
310 |
+ struct cpuinfo_x86 *c; |
311 |
+ |
312 |
++ if (!capable(CAP_SYS_RAWIO)) |
313 |
++ return -EPERM; |
314 |
++ |
315 |
+ cpu = iminor(file->f_path.dentry->d_inode); |
316 |
+ if (cpu >= nr_cpu_ids || !cpu_online(cpu)) |
317 |
+ return -ENXIO; /* No such CPU */ |
318 |
diff --git a/arch/x86/kernel/nmi.c b/arch/x86/kernel/nmi.c |
319 |
index e88f37b..1353db6 100644 |
320 |
--- a/arch/x86/kernel/nmi.c |
321 |
@@ -52785,10 +52807,10 @@ index 87323f1..dab9d00 100644 |
322 |
ip = issum ? mp->m_rsumip : mp->m_rbmip; |
323 |
diff --git a/grsecurity/Kconfig b/grsecurity/Kconfig |
324 |
new file mode 100644 |
325 |
-index 0000000..511310f |
326 |
+index 0000000..52786fd |
327 |
--- /dev/null |
328 |
+++ b/grsecurity/Kconfig |
329 |
-@@ -0,0 +1,1015 @@ |
330 |
+@@ -0,0 +1,1021 @@ |
331 |
+# |
332 |
+# grecurity configuration |
333 |
+# |
334 |
@@ -52802,18 +52824,24 @@ index 0000000..511310f |
335 |
+ help |
336 |
+ If you say Y here, /dev/kmem and /dev/mem won't be allowed to |
337 |
+ be written to or read from to modify or leak the contents of the running |
338 |
-+ kernel. /dev/port will also not be allowed to be opened. If you have module |
339 |
-+ support disabled, enabling this will close up four ways that are |
340 |
++ kernel. /dev/port will also not be allowed to be opened and support |
341 |
++ for /dev/cpu/*/msr will be removed. If you have module |
342 |
++ support disabled, enabling this will close up five ways that are |
343 |
+ currently used to insert malicious code into the running kernel. |
344 |
++ |
345 |
+ Even with all these features enabled, we still highly recommend that |
346 |
+ you use the RBAC system, as it is still possible for an attacker to |
347 |
+ modify the running kernel through privileged I/O granted by ioperm/iopl. |
348 |
++ |
349 |
+ If you are not using XFree86, you may be able to stop this additional |
350 |
+ case by enabling the 'Disable privileged I/O' option. Though nothing |
351 |
+ legitimately writes to /dev/kmem, XFree86 does need to write to /dev/mem, |
352 |
+ but only to video memory, which is the only writing we allow in this |
353 |
+ case. If /dev/kmem or /dev/mem are mmaped without PROT_WRITE, they will |
354 |
+ not be allowed to mprotect it with PROT_WRITE later. |
355 |
++ Enabling this feature will prevent the "cpupower" and "powertop" tools |
356 |
++ from working. |
357 |
++ |
358 |
+ It is highly recommended that you say Y here if you meet all the |
359 |
+ conditions above. |
360 |
+ |
361 |
@@ -53354,11 +53382,11 @@ index 0000000..511310f |
362 |
+config GRKERNSEC_AUDIT_GROUP |
363 |
+ bool "Single group for auditing" |
364 |
+ help |
365 |
-+ If you say Y here, the exec, chdir, and (un)mount logging features |
366 |
-+ will only operate on a group you specify. This option is recommended |
367 |
-+ if you only want to watch certain users instead of having a large |
368 |
-+ amount of logs from the entire system. If the sysctl option is enabled, |
369 |
-+ a sysctl option with name "audit_group" is created. |
370 |
++ If you say Y here, the exec and chdir logging features will only operate |
371 |
++ on a group you specify. This option is recommended if you only want to |
372 |
++ watch certain users instead of having a large amount of logs from the |
373 |
++ entire system. If the sysctl option is enabled, a sysctl option with |
374 |
++ name "audit_group" is created. |
375 |
+ |
376 |
+config GRKERNSEC_AUDIT_GID |
377 |
+ int "GID for auditing" |
378 |
|
379 |
diff --git a/3.7.5/0000_README b/3.7.5/0000_README |
380 |
index 71573a5..cecc634 100644 |
381 |
--- a/3.7.5/0000_README |
382 |
+++ b/3.7.5/0000_README |
383 |
@@ -2,7 +2,7 @@ README |
384 |
----------------------------------------------------------------------------- |
385 |
Individual Patch Descriptions: |
386 |
----------------------------------------------------------------------------- |
387 |
-Patch: 4420_grsecurity-2.9.1-3.7.5-201301281957.patch |
388 |
+Patch: 4420_grsecurity-2.9.1-3.7.5-201301311811.patch |
389 |
From: http://www.grsecurity.net |
390 |
Desc: hardened-sources base patch from upstream grsecurity |
391 |
|
392 |
|
393 |
diff --git a/3.7.5/4420_grsecurity-2.9.1-3.7.5-201301281957.patch b/3.7.5/4420_grsecurity-2.9.1-3.7.5-201301311811.patch |
394 |
similarity index 99% |
395 |
rename from 3.7.5/4420_grsecurity-2.9.1-3.7.5-201301281957.patch |
396 |
rename to 3.7.5/4420_grsecurity-2.9.1-3.7.5-201301311811.patch |
397 |
index 8d072d3..1a84583 100644 |
398 |
--- a/3.7.5/4420_grsecurity-2.9.1-3.7.5-201301281957.patch |
399 |
+++ b/3.7.5/4420_grsecurity-2.9.1-3.7.5-201301311811.patch |
400 |
@@ -8568,7 +8568,7 @@ index ad8f795..2c7eec6 100644 |
401 |
/* |
402 |
* Memory returned by kmalloc() may be used for DMA, so we must make |
403 |
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig |
404 |
-index 46c3bff..c2286e7 100644 |
405 |
+index 46c3bff..da289d1 100644 |
406 |
--- a/arch/x86/Kconfig |
407 |
+++ b/arch/x86/Kconfig |
408 |
@@ -241,7 +241,7 @@ config X86_HT |
409 |
@@ -8580,7 +8580,15 @@ index 46c3bff..c2286e7 100644 |
410 |
|
411 |
config ARCH_HWEIGHT_CFLAGS |
412 |
string |
413 |
-@@ -1056,7 +1056,7 @@ choice |
414 |
+@@ -1033,6 +1033,7 @@ config MICROCODE_OLD_INTERFACE |
415 |
+ |
416 |
+ config X86_MSR |
417 |
+ tristate "/dev/cpu/*/msr - Model-specific register support" |
418 |
++ depends on !GRKERNSEC_KMEM |
419 |
+ ---help--- |
420 |
+ This device gives privileged processes access to the x86 |
421 |
+ Model-Specific Registers (MSRs). It is a character device with |
422 |
+@@ -1056,7 +1057,7 @@ choice |
423 |
|
424 |
config NOHIGHMEM |
425 |
bool "off" |
426 |
@@ -8589,7 +8597,7 @@ index 46c3bff..c2286e7 100644 |
427 |
---help--- |
428 |
Linux can use up to 64 Gigabytes of physical memory on x86 systems. |
429 |
However, the address space of 32-bit x86 processors is only 4 |
430 |
-@@ -1093,7 +1093,7 @@ config NOHIGHMEM |
431 |
+@@ -1093,7 +1094,7 @@ config NOHIGHMEM |
432 |
|
433 |
config HIGHMEM4G |
434 |
bool "4GB" |
435 |
@@ -8598,7 +8606,7 @@ index 46c3bff..c2286e7 100644 |
436 |
---help--- |
437 |
Select this if you have a 32-bit processor and between 1 and 4 |
438 |
gigabytes of physical RAM. |
439 |
-@@ -1147,7 +1147,7 @@ config PAGE_OFFSET |
440 |
+@@ -1147,7 +1148,7 @@ config PAGE_OFFSET |
441 |
hex |
442 |
default 0xB0000000 if VMSPLIT_3G_OPT |
443 |
default 0x80000000 if VMSPLIT_2G |
444 |
@@ -8607,7 +8615,7 @@ index 46c3bff..c2286e7 100644 |
445 |
default 0x40000000 if VMSPLIT_1G |
446 |
default 0xC0000000 |
447 |
depends on X86_32 |
448 |
-@@ -1548,6 +1548,7 @@ config SECCOMP |
449 |
+@@ -1548,6 +1549,7 @@ config SECCOMP |
450 |
|
451 |
config CC_STACKPROTECTOR |
452 |
bool "Enable -fstack-protector buffer overflow detection" |
453 |
@@ -8615,7 +8623,7 @@ index 46c3bff..c2286e7 100644 |
454 |
---help--- |
455 |
This option turns on the -fstack-protector GCC feature. This |
456 |
feature puts, at the beginning of functions, a canary value on |
457 |
-@@ -1605,6 +1606,7 @@ config KEXEC_JUMP |
458 |
+@@ -1605,6 +1607,7 @@ config KEXEC_JUMP |
459 |
config PHYSICAL_START |
460 |
hex "Physical address where the kernel is loaded" if (EXPERT || CRASH_DUMP) |
461 |
default "0x1000000" |
462 |
@@ -8623,7 +8631,7 @@ index 46c3bff..c2286e7 100644 |
463 |
---help--- |
464 |
This gives the physical address where the kernel is loaded. |
465 |
|
466 |
-@@ -1668,6 +1670,7 @@ config X86_NEED_RELOCS |
467 |
+@@ -1668,6 +1671,7 @@ config X86_NEED_RELOCS |
468 |
config PHYSICAL_ALIGN |
469 |
hex "Alignment value to which kernel should be aligned" if X86_32 |
470 |
default "0x1000000" |
471 |
@@ -8631,7 +8639,7 @@ index 46c3bff..c2286e7 100644 |
472 |
range 0x2000 0x1000000 |
473 |
---help--- |
474 |
This value puts the alignment restrictions on physical address |
475 |
-@@ -1699,9 +1702,10 @@ config HOTPLUG_CPU |
476 |
+@@ -1699,9 +1703,10 @@ config HOTPLUG_CPU |
477 |
Say N if you want to disable CPU hotplug. |
478 |
|
479 |
config COMPAT_VDSO |
480 |
@@ -19602,6 +19610,20 @@ index 216a4d7..b328f09 100644 |
481 |
#if 0 |
482 |
if ((s64)val != *(s32 *)loc) |
483 |
goto overflow; |
484 |
+diff --git a/arch/x86/kernel/msr.c b/arch/x86/kernel/msr.c |
485 |
+index a7c5661..4929502 100644 |
486 |
+--- a/arch/x86/kernel/msr.c |
487 |
++++ b/arch/x86/kernel/msr.c |
488 |
+@@ -174,6 +174,9 @@ static int msr_open(struct inode *inode, struct file *file) |
489 |
+ unsigned int cpu; |
490 |
+ struct cpuinfo_x86 *c; |
491 |
+ |
492 |
++ if (!capable(CAP_SYS_RAWIO)) |
493 |
++ return -EPERM; |
494 |
++ |
495 |
+ cpu = iminor(file->f_path.dentry->d_inode); |
496 |
+ if (cpu >= nr_cpu_ids || !cpu_online(cpu)) |
497 |
+ return -ENXIO; /* No such CPU */ |
498 |
diff --git a/arch/x86/kernel/nmi.c b/arch/x86/kernel/nmi.c |
499 |
index f84f5c5..e27e54b 100644 |
500 |
--- a/arch/x86/kernel/nmi.c |
501 |
@@ -52223,10 +52245,10 @@ index 4e00cf0..3374374 100644 |
502 |
kfree(s); |
503 |
diff --git a/grsecurity/Kconfig b/grsecurity/Kconfig |
504 |
new file mode 100644 |
505 |
-index 0000000..5ce8347 |
506 |
+index 0000000..92247e4 |
507 |
--- /dev/null |
508 |
+++ b/grsecurity/Kconfig |
509 |
-@@ -0,0 +1,1015 @@ |
510 |
+@@ -0,0 +1,1021 @@ |
511 |
+# |
512 |
+# grecurity configuration |
513 |
+# |
514 |
@@ -52240,18 +52262,24 @@ index 0000000..5ce8347 |
515 |
+ help |
516 |
+ If you say Y here, /dev/kmem and /dev/mem won't be allowed to |
517 |
+ be written to or read from to modify or leak the contents of the running |
518 |
-+ kernel. /dev/port will also not be allowed to be opened. If you have module |
519 |
-+ support disabled, enabling this will close up four ways that are |
520 |
++ kernel. /dev/port will also not be allowed to be opened and support |
521 |
++ for /dev/cpu/*/msr will be removed. If you have module |
522 |
++ support disabled, enabling this will close up five ways that are |
523 |
+ currently used to insert malicious code into the running kernel. |
524 |
++ |
525 |
+ Even with all these features enabled, we still highly recommend that |
526 |
+ you use the RBAC system, as it is still possible for an attacker to |
527 |
+ modify the running kernel through privileged I/O granted by ioperm/iopl. |
528 |
++ |
529 |
+ If you are not using XFree86, you may be able to stop this additional |
530 |
+ case by enabling the 'Disable privileged I/O' option. Though nothing |
531 |
+ legitimately writes to /dev/kmem, XFree86 does need to write to /dev/mem, |
532 |
+ but only to video memory, which is the only writing we allow in this |
533 |
+ case. If /dev/kmem or /dev/mem are mmaped without PROT_WRITE, they will |
534 |
+ not be allowed to mprotect it with PROT_WRITE later. |
535 |
++ Enabling this feature will prevent the "cpupower" and "powertop" tools |
536 |
++ from working. |
537 |
++ |
538 |
+ It is highly recommended that you say Y here if you meet all the |
539 |
+ conditions above. |
540 |
+ |
541 |
@@ -52792,11 +52820,11 @@ index 0000000..5ce8347 |
542 |
+config GRKERNSEC_AUDIT_GROUP |
543 |
+ bool "Single group for auditing" |
544 |
+ help |
545 |
-+ If you say Y here, the exec, chdir, and (un)mount logging features |
546 |
-+ will only operate on a group you specify. This option is recommended |
547 |
-+ if you only want to watch certain users instead of having a large |
548 |
-+ amount of logs from the entire system. If the sysctl option is enabled, |
549 |
-+ a sysctl option with name "audit_group" is created. |
550 |
++ If you say Y here, the exec and chdir logging features will only operate |
551 |
++ on a group you specify. This option is recommended if you only want to |
552 |
++ watch certain users instead of having a large amount of logs from the |
553 |
++ entire system. If the sysctl option is enabled, a sysctl option with |
554 |
++ name "audit_group" is created. |
555 |
+ |
556 |
+config GRKERNSEC_AUDIT_GID |
557 |
+ int "GID for auditing" |