> I think you may be right, Elly. Multithreaded programs indeed have their
> stack running outside the stack segment, so this could happen there.
> splhi won't even do on a multiprocessor. One should probably lock down
> the segment.
> We've never seen this happen, of course — or rather, we haven't noticed
> this as the cause of a crash.
just to beat a dead horse, i disabled the check in question
and ran the following program with an invalid address.
the program faulted and the kernel did not care.
; cat evil.c
#include <u.h>
#include <libc.h>
extern void evil(void);
void
main(void)
{
evil();
exits("");
}
; cat evil.s
TEXT evil(SB), $0
PUSHL SP
MOVL $0xa0000000, SP
MOVL $1, AX
INT $64
POPL SP
RET
% 8.out
8.out 78: suicide: invalid address 0xa0000000/24 in sys call pc=0x1046
- erik