]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Do not allow mmap with the MAP_FIXED argument to map at address zero.
authorSimon L. B. Nielsen <simon@FreeBSD.org>
Sun, 27 Sep 2009 14:49:51 +0000 (14:49 +0000)
committerSimon L. B. Nielsen <simon@FreeBSD.org>
Sun, 27 Sep 2009 14:49:51 +0000 (14:49 +0000)
commit27bfa95847f7addd4ec49e41ea2a916aeadb9418
treeb3b7c6170e31409ed248add9374de01bc5f499de
parent71f99e637a35759dc3d4906c6ce368988025c151
Do not allow mmap with the MAP_FIXED argument to map at address zero.
This is done to make it harder to exploit kernel NULL pointer security
vulnerabilities.  While this of course does not fix vulnerabilities,
it does mitigate their impact.

Note that this may break some applications, most likely emulators or
similar, which for one reason or another require mapping memory at
zero.

This restriction can be disabled with the security.bsd.mmap_zero
sysctl variable.

Discussed with: rwatson, bz
Tested by: bz (Wine), simon (VirtualBox)
Submitted by: jhb
sys/vm/vm_mmap.c