Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
2.6.30-r4: DEFAULT_MMAP_MIN_ADDR [Solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
Bones McCracker
Veteran
Veteran


Joined: 14 Mar 2006
Posts: 1611
Location: U.S.A.

PostPosted: Thu Jul 23, 2009 4:28 pm    Post subject: 2.6.30-r4: DEFAULT_MMAP_MIN_ADDR [Solved] Reply with quote

This is what was generated as a default value when I ran 'make oldconfig' to prepare to build gentoo-sources-2.6.30-r4 on an x86 (Pentium 4 with only 768 MiB RAM).

CONFIG_DEFAULT_MMAP_MIN_ADDR=4096

However, the help text for this kernel configuration variable reads as follows, apparently suggesting a value of 65536. So I'm wondering if the default is fixed number or generated based on this machine's resources, and I'm wondering what people think this should be set to.

Code:

CONFIG_DEFAULT_MMAP_MIN_ADDR:

This is the portion of low virtual memory which should be protected
from userspace allocation.  Keeping a user from writing to low pages
can help reduce the impact of kernel NULL pointer bugs.

For most ia64, ppc64 and x86 users with lots of address space
a value of 65536 is reasonable and should cause no problems.
On arm and other archs it should not be higher than 32768.
Programs which use vm86 functionality would either need additional
permissions from either the LSM or the capabilities module or have
this protection disabled.

This value can be changed after boot using the
/proc/sys/vm/mmap_min_addr tunable.

Symbol: DEFAULT_MMAP_MIN_ADDR [=4096]
Prompt: Low address space to protect from user allocation
   Defined at mm/Kconfig:229
   Location:
     -> Processor type and features


I assume this has to do with the null pointer exploit was talked about recently.
_________________
patrix_neo wrote:
The human thought: I cannot win.
The ratbrain in me : I can only go forward and that's it.


Last edited by Bones McCracker on Fri Jul 31, 2009 2:41 am; edited 1 time in total
Back to top
View user's profile Send private message
chris.c.hogan
Apprentice
Apprentice


Joined: 02 Oct 2005
Posts: 189

PostPosted: Thu Jul 30, 2009 2:37 am    Post subject: Reply with quote

I had this question myself and did some Googling... It's how I found your message.

Reading http://lkml.indiana.edu/hypermail/linux/kernel/0806.2/2733.html, it looks like most distributions are setting this to 64k. However, that seems to be causing problems for Wine and DOSEmu. Several bug reports are suggesting setting it to 0. However, that removes the protections that MMAP_MIN_ADDR provides. Setting it to PAGE_SIZE (4k in my case) allows the emulators to run while still providing some protections against null pointer exploits. As pointed out in the link, "there's a few things in the kernel that are bigger than 4K (or rather, lead to pointers beyond 4K)"

My interpretation of the above is to set it to 64k and see if you have any problems. It looks like LSM, SELinux and CAP might support per application control. /proc/sys/vm/mmap_min_addr is also available.

As a side, shouldn't this be in Kernel & Hardware?
Back to top
View user's profile Send private message
Bones McCracker
Veteran
Veteran


Joined: 14 Mar 2006
Posts: 1611
Location: U.S.A.

PostPosted: Thu Jul 30, 2009 3:45 am    Post subject: Reply with quote

Thank you.

Yes it should be.
Back to top
View user's profile Send private message
desultory
Bodhisattva
Bodhisattva


Joined: 04 Nov 2005
Posts: 9410

PostPosted: Fri Jul 31, 2009 2:51 am    Post subject: Reply with quote

Moved from Off the Wall to Kernel & Hardware, at BoneKracker's request.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum