VM for device drivers?
Posted Sep 13, 2005 1:17 UTC (Tue) by
mcelrath (guest, #8094)
In reply to:
VM for device drivers? by giraffedata
Parent article:
4K stacks for everyone?
Dirth isn't a word. The word you wanted is dearth. (back at cha)
Anyway, one really needs an oops or panic if the kernel stack is overflowed. A previous poster said page faults in kernel space aren't detectable. You are proposing a 4k page at the end of the stack to check if the stack has overflowed. If there are no page faults in kernel space, then one has to check the stack-overflow page on every process switch? That seems expensive.
Then on the other hand this overflow page can probably be only one physical page, shared among all processes (and an oops or panic if ANY process writes it), and if a page fault isn't possible then the task switch could just do an
if(stack_overflow[0] != STACK_OVERFLOW_PATTERN) { oops }
e.g. just check the first byte. So overall it costs 1 cmp per task switch and 4k. Seems much better than silent stack overflows, and the possible security flaws that might come from them too...
(
Log in to post comments)