]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Implement a (soft) stack guard page for auto-growing stack mappings.
authorkib <kib@FreeBSD.org>
Sun, 14 Nov 2010 17:53:52 +0000 (17:53 +0000)
committerkib <kib@FreeBSD.org>
Sun, 14 Nov 2010 17:53:52 +0000 (17:53 +0000)
commit81eb2c446be754e8f34cd961248d3ab376688e82
tree7e01ed40c98706e6f5ab528d7e1ac725b8d39397
parentf1bbcabe40e2f8458e8653913402d53e48bf0f70
Implement a (soft) stack guard page for auto-growing stack mappings.
The unmapped page separates the tip of the stack and possible adjanced
segment, making some uses of stack overflow harder.  The stack growing
code refuses to expand the segment to the last page of the reseved
region when sysctl security.bsd.stack_guard_page is set to 1. The
default value for sysctl and accompanying tunable is 0.

Please note that mmap(MAP_FIXED) still can place a mapping right up to
the stack, making continuous region.

Reviewed by: alc
MFC after: 1 week
sys/vm/vm_map.c