freebsd-dev/lib/libc
Konstantin Belousov 19bd0d9c85 Implement address space guards.
Guard, requested by the MAP_GUARD mmap(2) flag, prevents the reuse of
the allocated address space, but does not allow instantiation of the
pages in the range.  It is useful for more explicit support for usual
two-stage reserve then commit allocators, since it prevents accidental
instantiation of the mapping, e.g. by mprotect(2).

Use guards to reimplement stack grow code.  Explicitely track stack
grow area with the guard, including the stack guard page.  On stack
grow, trivial shift of the guard map entry and stack map entry limits
makes the stack expansion.  Move the code to detect stack grow and
call vm_map_growstack(), from vm_fault() into vm_map_lookup().

As result, it is impossible to get random mapping to occur in the
stack grow area, or to overlap the stack guard page.

Enable stack guard page by default.

Reviewed by:	alc, markj
Man page update reviewed by:	alc, bjk, emaste, markj, pho
Tested by:	pho, Qualys
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D11306 (man pages)
2017-06-24 17:01:11 +00:00
..
aarch64 Decrease relative branch brittleness. 2017-06-20 07:25:38 +00:00
amd64 Correct an misunderstanding of MDSRCS. 2017-03-02 17:07:28 +00:00
arm Correct an misunderstanding of MDSRCS. 2017-03-02 17:07:28 +00:00
capability Replace dot-dot relative pathing with SRCTOP-relative paths where possible 2017-01-20 03:23:24 +00:00
compat-43 Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
db Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
gdtoa For now, compile all of contrib/gdtoa without requiring strict aliasing, 2017-02-13 20:13:29 +00:00
gen Do not leak syslog_mutex on cancellation. 2017-06-17 11:29:59 +00:00
gmon Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
i386 Correct an misunderstanding of MDSRCS. 2017-03-02 17:07:28 +00:00
iconv __iconv_get_list: separate .Nm entries with commas 2017-05-23 07:02:01 +00:00
include Forward compatibility for ino64. 2017-06-23 18:06:20 +00:00
inet libc: remove use of archaic __P() macro 2017-03-30 01:03:07 +00:00
isc libc: do not include <sys/types.h> where <sys/param.h> was already included 2016-04-18 21:05:15 +00:00
locale localeconv(3): start sentences on new lines 2017-05-23 07:09:26 +00:00
md Replace dot-dot relative pathing with SRCTOP-relative paths where possible 2017-01-20 03:23:24 +00:00
mips Replace SOFTFLOAT with __mips_soft_float, which gcc/clang define for us. 2017-03-16 21:05:21 +00:00
nameser libc: spelling fixes. 2016-04-30 01:24:24 +00:00
net Don't end up manpage titles with a full stop. 2017-05-24 21:02:53 +00:00
nls Use current locale (f.e. set by thread). It was global locale always 2016-08-24 16:44:27 +00:00
posix1e acl_to_text(3): start sentences on new lines 2017-05-23 07:12:31 +00:00
powerpc Correct an misunderstanding of MDSRCS. 2017-03-02 17:07:28 +00:00
powerpc64 Correct an misunderstanding of MDSRCS. 2017-03-02 17:07:28 +00:00
powerpcspe Correct an misunderstanding of MDSRCS. 2017-03-02 17:07:28 +00:00
quad Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
regex Correct an out-of-bounds read in regcomp when the RE is bad. 2017-05-02 21:20:27 +00:00
resolv Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
riscv Use unconditional jr (jump register) so cerror relocation offset fits. 2017-04-27 22:40:39 +00:00
rpc Fix use-after-free introduced in r300388. 2017-06-22 05:10:16 +00:00
secure libc: do not include <sys/types.h> where <sys/param.h> was already included 2016-04-18 21:05:15 +00:00
softfloat Add full softfloat and hardfloat support for RISC-V. 2016-11-16 15:21:32 +00:00
sparc64 Correct an misunderstanding of MDSRCS. 2017-03-02 17:07:28 +00:00
stdio fopencookie(3): declare function pointers in SYNOPSIS correctly 2017-05-23 07:15:57 +00:00
stdlib Update jemalloc to 5.0.0. 2017-06-15 07:15:05 +00:00
stdtime Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
string Fix strcoll_l disagreeing with strxfrm by reworking the forward order case in 2017-04-16 19:12:07 +00:00
sys Implement address space guards. 2017-06-24 17:01:11 +00:00
tests tsearch_test: Test twalk & add some determinism. 2017-06-06 03:40:45 +00:00
uuid libc: replace 0 with NULL for pointers. 2016-04-10 19:33:58 +00:00
x86/sys Remove unneeded variable initialization from r314319. 2017-02-26 22:15:39 +00:00
xdr * limit size of buffers to RPC_MAXDATASIZE 2017-06-01 06:12:25 +00:00
yp Use on crypto.x and rpc.x from the source tree. 2016-06-28 19:53:16 +00:00
libc_nossp.ldscript Add different libc ldscript: the one without libssp -- 2016-10-12 13:19:21 +00:00
libc.ldscript Attempt to move the POSIX iconv* symbols out of runtime linker space. 2013-11-17 22:52:17 +00:00
Makefile Replace dot-dot relative pathing with SRCTOP-relative paths where possible 2017-01-20 03:23:24 +00:00
Makefile.depend DIRDEPS_BUILD: Regenerate without local dependencies. 2016-02-24 17:20:11 +00:00
Versions.def Create namespace for the symbols added during 12-CURRENT cycle. 2016-08-06 13:28:58 +00:00