diff options
| author | Felix Morgner <felix.morgner@ost.ch> | 2026-09-05 13:19:25 +0200 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@ost.ch> | 2026-09-05 13:19:25 +0200 |
| commit | 9f544dea5dbcdb92f614c6092a60e81d3398b8da (patch) | |
| tree | 2a7098a472b7ef45092c830850b1625492fa04f3 /arch/x86_64 | |
| parent | c0b2173d6b6c4587d1df3e8ea992ee19c9ff4418 (diff) | |
| download | kernel-9f544dea5dbcdb92f614c6092a60e81d3398b8da.tar.xz kernel-9f544dea5dbcdb92f614c6092a60e81d3398b8da.zip | |
build: enable strong stack protector
Diffstat (limited to 'arch/x86_64')
| -rw-r--r-- | arch/x86_64/arch/boot/initialize_runtime.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/x86_64/arch/boot/initialize_runtime.cpp b/arch/x86_64/arch/boot/initialize_runtime.cpp index e548f4a1..ad2fa205 100644 --- a/arch/x86_64/arch/boot/initialize_runtime.cpp +++ b/arch/x86_64/arch/boot/initialize_runtime.cpp @@ -1,3 +1,5 @@ +#include <kapi/system.hpp> + #include <algorithm> #include <functional> #include <span> @@ -12,6 +14,15 @@ namespace arch::boot // NOLINTBEGIN(readability-identifier-naming) extern global_initializer __init_array_start; extern global_initializer __init_array_end; + + [[gnu::used]] + constinit auto __stack_chk_guard = 0xcafe'face'1ee7'8ee7; // NOLINT(readability-magic-numbers) + + [[noreturn]] + auto __stack_chk_fail() -> void + { + kapi::system::panic("Stack smashing detected!"); + } // NOLINTEND(readability-identifier-naming) auto invoke_global_constructors() -> void |
