On 08/23/2012 12:37 PM, Andrew Bernat wrote:
> Sounds like a plan. That code is pretty fuzzy (as in logic) anyway - we
> clearly don't want to allocate the zero page, but we don't have any
> reason to get it as low as possible. I'll add the tweak.
>
> Is there a way to get CONFIG_LSM_... programmatically?
I don't know a way to read it, besides the obvious (but unreliable)
/boot/config-`uname -r`. There is /proc/sys/vm/mmap_min_addr, but this
is actually a separate control; see the kernel's security/min_addr.c.
So on Fedora that sysctl is only 4096 even while LSM is 65536.
However, if it really doesn't matter that the mmap is so low, then why
not pick somewhere arbitrary for the starting point? The 32-bit case is
using loAddr=0x50000000. The 64-bit case could use the same, or choose
some other wild loAddr in the huge address space.
For that matter, why do you want mmap in specific ranges at all? If you
don't care where this ends up, then just mmap(NULL,...) and let the
kernel find an open address in a single syscall.
Josh
|