Skip to contentSkip to conversation

Non-Exec stack patches

DISCUSSION Andi Kleen 2 participants 2 messages Mar 24, 2004 11 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): 16480.55450.730214.175997@napali.hpl.hp.com.suse.lists.linux.kernel

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): 16480.59229.808025.231875@napali.hpl.hp.com.suse.lists.linux.kernel

A message that is not in the archive (sent off-list or not yet received): 20040324070020.GI31589@devserv.devel.redhat.com.suse.lists.linux.kernel

A message that is not in the archive (sent off-list or not yet received): 16481.13780.673796.20976@napali.hpl.hp.com.suse.lists.linux.kernel

A message that is not in the archive (sent off-list or not yet received): 20040324072840.GK31589@devserv.devel.redhat.com.suse.lists.linux.kernel

A message that is not in the archive (sent off-list or not yet received): 16481.15493.591464.867776@napali.hpl.hp.com.suse.lists.linux.kernel

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): 16481.49534.124281.434663@napali.hpl.hp.com.suse.lists.linux.kernel

A message that is not in the archive (sent off-list or not yet received): 20040324172454.GP31589@devserv.devel.redhat.com.suse.lists.linux.kernel

Andi Kleen

author
#11 lore raw
Quoted 4 lines · Jakub Jelinek

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 down.

And cache a flag about this in a TLS variable.

-Andi

#12 lore raw
Quoted 4 lines · Andi Kleen

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 down.

That assumes there are always gaps around thread stacks, which doesn't have to be true. You could make executable some other mapping as well easily.

Jakub