> #ifndef SLOW_BUT_SAFE_KERNEL_STACKS
>
> #define alloc_kernel_stack() __get_free_page(GFP_KERNEL)
> #define free_kernel_stack(page) free_page((page))
>
> #else
>
> #define alloc_kernel_stack() vmalloc(4096)
> #define free_kernel_stack(page) vfree((page))
>
> #endif
>
> thus all kernel stacks are MMU protected and separated by a zero pte? I
> havent checked this (yet), just wondering wether someone has done this
> already. This is a bit safer (and the resulting fault is much more
> informative).
well currently the fault will be a triple fault, thus making the situation
much worse than the current STACK_MAGIC solution.
but what if we make the double fault handler a task gate? We could call a
special i386 task (with a correct stack), to get the previous task cleaned
up. As far as i remember, such task switch pushes nothing to the old
stack, thus we cannot see a triple fault ...
is this correct?
-- mingo