summaryrefslogtreecommitdiff
path: root/src/env/__init_security.c
AgeCommit message (Collapse)AuthorLines
2012-04-24first attempt at enabling stack protector supportRich Felker-0/+7
the code is written to pre-init the thread pointer in static linked programs that pull in __stack_chk_fail or dynamic-linked programs that lookup the symbol. no explicit canary is set; the canary will be whatever happens to be in the thread structure at the offset gcc hard-coded. this can be improved later.
2011-08-23security hardening: ensure suid programs have valid stdin/out/errRich Felker-0/+26
this behavior (opening fds 0-2 for a suid program) is explicitly allowed (but not required) by POSIX to protect badly-written suid programs from clobbering files they later open. this commit does add some cost in startup code, but the availability of auxv and the security flag will be useful elsewhere in the future. in particular auxv is needed for static-linked vdso support, which is still waiting to be committed (sorry nik!)