freebsd-dev/lib/libc/secure
Konstantin Belousov 989b861f5c Carefully update stack guard bytes inside __guard_setup().
This is necessary to make sure that functions that can have stack
protection are not used to update the stack guard. If not, the stack
guard check would fail when it shouldn't.

guard_setup() calls elf_aux_info(), which, in turn, calls memcpy() to
update stack_chk_guard.  If either elf_aux_info() or memcpy() have
stack protection enabled, __stack_chk_guard will be modified before
returning from them, causing the stack protection check to fail.

This change uses a temporary buffer to delay changing
__stack_chk_guard until elf_aux_info() returns.

Submitted by:	Luis Pires
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D15173
2018-04-24 15:59:39 +00:00
..
Makefile.inc libc: don't build compat functions if building WITHOUT_SYMVER 2016-03-15 19:26:32 +00:00
stack_protector_compat.c
stack_protector.c Carefully update stack guard bytes inside __guard_setup(). 2018-04-24 15:59:39 +00:00
Symbol.map