Re: Non-Exec stack patches

From: Andi Kleen
Date: Wed Mar 24 2004 - 12:50:19 EST

Jakub Jelinek <jakub@xxxxxxxxxx> writes:
> Nope. Think about multithreaded apps. Furthermore, getting the exact
> extents of the particular stack is difficult to find for applications,
> but e.g. the threading library has to know such things.

It's actually not that difficult. You just have to read /proc/self/maps
and check for the mapping of your current stack pointer.
For the main stack GROWSDOWN will inherit the x or nx on growing

And cache a flag about this in a TLS variable.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at