opnsense-src/lib/libc
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
..
aarch64
amd64
arm
capability
compat-43
db
gdtoa
gen
gmon
i386
iconv
include
inet
isc
locale
md
mips
nameser
net
nls
posix1e
powerpc
powerpc64
powerpcspe
quad
regex
resolv
riscv
rpc
secure
softfloat
sparc64
stdio
stdlib
stdtime
string
sys
tests
uuid
x86/sys
xdr
yp
libc.ldscript
libc_nossp.ldscript
Makefile
Makefile.depend
Versions.def