2.4.36-stable kernel tree
Revision | f48a7236220bf6ed94ed14eece07d096bf68894f (tree) |
---|---|
Zeit | 2006-08-31 06:04:31 |
Autor | PaX Team <pageexec@free...> |
Commiter | Willy Tarreau |
[PATCH] i386 : fix exception processing in early boot
fix the longest existing kernel bug ever (since 0.01 ;-). basically,
the dummy interrupt handler installed for the early boot period does
not work for exceptions that push an error code as well, effectively
making the iret at the end of the handler to trigger another exception,
ad infinitum, or rather, until the kernel stack runs over, trashes all
memory below and eventually causes a CPU reset or a hang. without this
fix the early printk facility in 2.6 is also rather useless.
@@ -325,27 +325,21 @@ ENTRY(stack_start) | ||
325 | 325 | |
326 | 326 | /* This is the default interrupt "handler" :-) */ |
327 | 327 | int_msg: |
328 | - .asciz "Unknown interrupt\n" | |
328 | + .asciz "Unknown interrupt, stack: %p %p %p %p\n" | |
329 | 329 | ALIGN |
330 | 330 | ignore_int: |
331 | 331 | cld |
332 | - pushl %eax | |
333 | - pushl %ecx | |
334 | - pushl %edx | |
335 | - pushl %es | |
336 | - pushl %ds | |
337 | 332 | movl $(__KERNEL_DS),%eax |
338 | 333 | movl %eax,%ds |
339 | 334 | movl %eax,%es |
335 | + pushl 12(%esp) | |
336 | + pushl 12(%esp) | |
337 | + pushl 12(%esp) | |
338 | + pushl 12(%esp) | |
340 | 339 | pushl $int_msg |
341 | 340 | call SYMBOL_NAME(printk) |
342 | - popl %eax | |
343 | - popl %ds | |
344 | - popl %es | |
345 | - popl %edx | |
346 | - popl %ecx | |
347 | - popl %eax | |
348 | - iret | |
341 | +1: hlt | |
342 | + jmp 1b | |
349 | 343 | |
350 | 344 | /* |
351 | 345 | * The interrupt descriptor table has room for 256 idt's, |