Previous Entry Add to Memories Share
SELinux hardening for mmap_min_addr protections
So in the last article I talked about how SELinux systems provide stronger protections against mapping low memory regions for remote attacks, but are weaker against attacks from authenticated users running unconfined.  The surprise to users that their SELinux enabled system could be weaker to some class of attacks was labeled CVE-2009-2695.

After a bit of thought I've decided the best way to address this is for LSMs to abandon the mmap_min_addr tunable altogether.  That tunable lets a root user disable protections.  Why would an LSM want a root user to be able to control it's protections at all?  What it protects should be defined entirely by the kernel and the policy.  So, what I've done is to separate out the mmap_min_addr root vs. non-root check and the LSM check.  There is a new hard coded at kernel compile time amount of memory protected by the LSM.  This is unrelated to the /proc/sys/vm/mmap_min_addr file.  You can set that to 0 and the LSM will still be able to protect low memory.

So in upstream kernels (2.6.30-rc6ish and later) to map the 0 page you will need both CAP_SYS_RAWIO (root) and the SELinux memprotect/mmap_zero permission instead of only needing one or the other.  If you set /proc/sys/vm/mmap_min_addr to 0 you will still need the SELinux mamprotect/mmap_zero permission.

Hurray until the next time someone finds a way to map the 0 page and a null pointer bug in the kernel (lots of the latter as of late)

Is a security blog about SELinux being Spam-blogged.

You are viewing eparis