public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH RFC 0/5] tools/nolibc: add support for stack protector
@ 2023-03-07 22:22 Thomas Weißschuh
  2023-03-07 22:22 ` [PATCH RFC 1/5] tools/nolibc: add definitions for standard fds Thomas Weißschuh
                   ` (4 more replies)
  0 siblings, 5 replies; 14+ messages in thread
From: Thomas Weißschuh @ 2023-03-07 22:22 UTC (permalink / raw)
  To: Willy Tarreau, Shuah Khan
  Cc: linux-kernel, linux-kselftest, Thomas Weißschuh

Stack protection is a feature to detect and handle stack buffer
overflows at runtime.
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>
---
Thomas Weißschuh (5):
      tools/nolibc: add definitions for standard fds
      tools/nolibc: add helpers for wait() signal exits
      tools/nolibc: tests: constify test_names
      tools/nolibc: add support for stack protector
      tools/nolibc: tests: add test for -fstack-protector

 tools/include/nolibc/Makefile                |  4 +-
 tools/include/nolibc/arch-i386.h             |  8 ++-
 tools/include/nolibc/arch-x86_64.h           |  5 ++
 tools/include/nolibc/nolibc.h                |  1 +
 tools/include/nolibc/stackprotector.h        | 48 ++++++++++++++++++
 tools/include/nolibc/types.h                 |  2 +
 tools/include/nolibc/unistd.h                |  5 ++
 tools/testing/selftests/nolibc/Makefile      | 12 +++++
 tools/testing/selftests/nolibc/nolibc-test.c | 76 ++++++++++++++++++++++++++--
 9 files changed, 155 insertions(+), 6 deletions(-)
---
base-commit: b7453ccfdbe0b9e95b488814c53e8cbf8966aae4
change-id: 20230223-nolibc-stackprotector-d4d5f48ff771

Best regards,
-- 
Thomas Weißschuh <linux@weissschuh.net>


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2023-03-19 13:58 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-07 22:22 [PATCH RFC 0/5] tools/nolibc: add support for stack protector Thomas Weißschuh
2023-03-07 22:22 ` [PATCH RFC 1/5] tools/nolibc: add definitions for standard fds Thomas Weißschuh
2023-03-07 22:22 ` [PATCH RFC 2/5] tools/nolibc: add helpers for wait() signal exits Thomas Weißschuh
2023-03-07 22:22 ` [PATCH RFC 3/5] tools/nolibc: tests: constify test_names Thomas Weißschuh
2023-03-07 22:22 ` [PATCH RFC 4/5] tools/nolibc: add support for stack protector Thomas Weißschuh
2023-03-12 12:56   ` Willy Tarreau
2023-03-12 23:06     ` Thomas Weißschuh
2023-03-13  3:24       ` Willy Tarreau
2023-03-07 22:22 ` [PATCH RFC 5/5] tools/nolibc: tests: add test for -fstack-protector Thomas Weißschuh
2023-03-12 13:07   ` Willy Tarreau
2023-03-12 23:12     ` Thomas Weißschuh
2023-03-13  3:08       ` Willy Tarreau
2023-03-18 16:49         ` Thomas Weißschuh
2023-03-19 13:58           ` Willy Tarreau

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox