• R/O
  • HTTP
  • SSH
  • HTTPS

linux-2.4.36: Commit

2.4.36-stable kernel tree


Commit MetaInfo

Revision51e31546a2fc46cb978da2ee0330a6a68f07541e (tree)
Zeit2005-07-01 08:02:14
AutorAndi Kleen <ak@suse...>
CommiterMarcelo Tosatti

Log Message

[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>

Ändern Zusammenfassung

Diff

--- a/arch/x86_64/kernel/traps.c
+++ b/arch/x86_64/kernel/traps.c
@@ -857,7 +857,7 @@ void __init trap_init(void)
857857 set_intr_gate(9,&coprocessor_segment_overrun);
858858 set_intr_gate(10,&invalid_TSS);
859859 set_intr_gate(11,&segment_not_present);
860- set_intr_gate_ist(12,&stack_segment,STACKFAULT_STACK);
860+ set_intr_gate(12,&stack_segment);
861861 set_intr_gate(13,&general_protection);
862862 set_intr_gate(14,&page_fault);
863863 set_intr_gate(15,&spurious_interrupt_bug);
--- a/include/asm-x86_64/processor.h
+++ b/include/asm-x86_64/processor.h
@@ -325,10 +325,9 @@ struct thread_struct {
325325 #define INIT_MMAP \
326326 { &init_mm, 0, 0, NULL, PAGE_SHARED, VM_READ | VM_WRITE | VM_EXEC, 1, NULL, NULL }
327327
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 */
332331 #define EXCEPTION_STKSZ PAGE_SIZE
333332 #define EXCEPTION_STK_ORDER 0
334333
Show on old repository browser