2.4.36-stable kernel tree
Revision | 51e31546a2fc46cb978da2ee0330a6a68f07541e (tree) |
---|---|
Zeit | 2005-07-01 08:02:14 |
Autor | Andi Kleen <ak@suse...> |
Commiter | Marcelo Tosatti |
[PATCH] x86_64: Disable exception stack for stack faults
Stack segment faults were executed on a exception stack. But they
use the normal return path and can schedule there, but scheduling
is not allowed on a exception stack.
Just drop the exception stack for stack segment faults. This
will make some oops triple fault now, but that's better than
allowing user triggerable oops.
Double faults still have this problem, but if they happen you
have enough other problems already that this one doesn't matter
anymore.
2.6 has a more complicated fix here that actually handles
this properly, but for 2.4 the simple version is better.
Found from RedHat QA using crashme
Signed-off-by: Andi Kleen <ak@suse.de>
@@ -857,7 +857,7 @@ void __init trap_init(void) | ||
857 | 857 | set_intr_gate(9,&coprocessor_segment_overrun); |
858 | 858 | set_intr_gate(10,&invalid_TSS); |
859 | 859 | set_intr_gate(11,&segment_not_present); |
860 | - set_intr_gate_ist(12,&stack_segment,STACKFAULT_STACK); | |
860 | + set_intr_gate(12,&stack_segment); | |
861 | 861 | set_intr_gate(13,&general_protection); |
862 | 862 | set_intr_gate(14,&page_fault); |
863 | 863 | set_intr_gate(15,&spurious_interrupt_bug); |
@@ -325,10 +325,9 @@ struct thread_struct { | ||
325 | 325 | #define INIT_MMAP \ |
326 | 326 | { &init_mm, 0, 0, NULL, PAGE_SHARED, VM_READ | VM_WRITE | VM_EXEC, 1, NULL, NULL } |
327 | 327 | |
328 | -#define STACKFAULT_STACK 1 | |
329 | -#define DOUBLEFAULT_STACK 2 | |
330 | -#define NMI_STACK 3 | |
331 | -#define N_EXCEPTION_STACKS 3 /* hw limit: 7 */ | |
328 | +#define DOUBLEFAULT_STACK 1 | |
329 | +#define NMI_STACK 2 | |
330 | +#define N_EXCEPTION_STACKS 2 /* hw limit: 7 */ | |
332 | 331 | #define EXCEPTION_STKSZ PAGE_SIZE |
333 | 332 | #define EXCEPTION_STK_ORDER 0 |
334 | 333 |