Re: Unexecutable stack

Alan Cox (alan@lxorguk.ukuu.org.uk)
Tue, 28 Dec 1999 16:46:05 +0000 (GMT)


> Could the designer of the non-executable-stack code please explain how
> this works on an ix86 machine? The ix86 can't differentiate
> between read and execute in hardware. This means that either the
> patch for ix86 is a no-op or, (I shudder), a trap is executed on
> every user stack access, and the kernel code does a comparison.

Or the author is smart.. which is the case. The patch changes the ring 3
code segment descriptor to limit below the stack. Executing code on the stack
traps via a trampoline detector. It works rather nicely considering the limits
the CPU imposes.

On sane machines the kernel does not need to be involved - you can do non
executable stack simply by fixing ld.so and glibc a little on many platforms

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/