linux/tools/include/nolibc
Thomas Weißschuh 7188d4637e tools/nolibc: add support for stack protector
This is useful when using nolibc for security-critical tools.
Using nolibc has the advantage that the code is easily auditable and
sandboxable with seccomp as no unexpected syscalls are used.
Using compiler-assistent stack protection provides another security
mechanism.

For this to work the compiler and libc have to collaborate.

This patch adds the following parts to nolibc that are required by the
compiler:

* __stack_chk_guard: random sentinel value
* __stack_chk_fail: handler for detected stack smashes

In addition an initialization function is added that randomizes the
sentinel value.

Only support for global guards is implemented.
Register guards are useful in multi-threaded context which nolibc does
not provide support for.

Link: https://lwn.net/Articles/584225/

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Signed-off-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
2023-03-27 16:26:10 -07:00
..
.gitignore tools/nolibc: Add gitignore to avoid git complaints about sysroot 2023-03-20 08:45:21 -07:00
arch-aarch64.h tools/nolibc: add auxiliary vector retrieval for arm64 2023-01-10 13:33:56 -08:00
arch-arm.h tools/nolibc: add auxiliary vector retrieval for arm 2023-01-10 13:33:56 -08:00
arch-i386.h tools/nolibc: add auxiliary vector retrieval for i386 2023-01-10 13:33:56 -08:00
arch-loongarch.h tools/nolibc: Add support for LoongArch 2023-03-20 08:45:22 -07:00
arch-mips.h tools/nolibc: add auxiliary vector retrieval for mips 2023-01-10 13:33:56 -08:00
arch-riscv.h tools/nolibc: add auxiliary vector retrieval for riscv 2023-01-10 13:33:56 -08:00
arch-s390.h tools/nolibc: add auxiliary vector retrieval for s390 2023-01-10 13:33:56 -08:00
arch-x86_64.h tools/nolibc: add auxiliary vector retrieval for x86_64 2023-01-10 13:33:56 -08:00
arch.h tools/nolibc: Add support for LoongArch 2023-03-20 08:45:22 -07:00
ctype.h tools/nolibc: fix missing includes causing build issues at -O0 2023-01-09 09:36:05 -08:00
errno.h tools/nolibc: make errno a weak symbol instead of a static one 2023-01-10 13:33:55 -08:00
Makefile tools/nolibc: add support for stack protector 2023-03-27 16:26:10 -07:00
nolibc.h tools/nolibc: add support for stack protector 2023-03-27 16:26:10 -07:00
signal.h tools/nolibc: fix missing includes causing build issues at -O0 2023-01-09 09:36:05 -08:00
stackprotector.h tools/nolibc: add support for stack protector 2023-03-27 16:26:10 -07:00
std.h tools/nolibc: add stdint.h 2023-03-20 08:45:21 -07:00
stdint.h tools/nolibc: add integer types and integer limit macros 2023-03-20 08:45:21 -07:00
stdio.h tools/nolibc: fix missing includes causing build issues at -O0 2023-01-09 09:36:05 -08:00
stdlib.h nolibc/stdlib: Implement getauxval(3) function 2023-01-10 13:33:56 -08:00
string.h tools/nolibc: prevent gcc from making memset() loop over itself 2023-01-09 09:36:05 -08:00
sys.h tools/nolibc: Add statx() and make stat() rely on statx() if necessary 2023-03-20 08:45:22 -07:00
time.h tools/nolibc: fix missing includes causing build issues at -O0 2023-01-09 09:36:05 -08:00
types.h tools/nolibc: add helpers for wait() signal exits 2023-03-27 16:26:10 -07:00
unistd.h tools/nolibc: add definitions for standard fds 2023-03-27 16:26:10 -07:00