mmap(0,...) placement options
Posted May 6, 2003 14:48 UTC (Tue) by
jreiser (subscriber, #11027)
Parent article:
"Exec Shield" for Linux
A related idea is giving the user more control over mmap(0,...) in general.
Make TASK_UNMAPPED_BASE an inherited part of process state, and control it
with setrlimit()/getrlimit(). With .task_unmapped_base set to 1MB, then
in Ingo's "cat" example even the locale pages would reside in ASCII Armor.
The cost is 4 bytes of process state, plus a few lines in setrlimit/getrlimit.
Kasper Dupont has developed patches to support this. See here.
Also, the builders of applications can arrange for "ASCII Armor" placement
of mmap(0,...) even in systems without kernel patches. See my project
tub.
Further, if the kernel provided a binary structure interface to /proc/self/maps
then it would be much easier and more reliable for users to do these things
by themselves. Win32 has an interface VirtualQuery() which provides for
introspective examination of the address space mappings.
(
Log in to post comments)