mirror of
https://github.com/wichtounet/thor-os.git
synced 2025-08-04 09:46:10 -04:00
Support for SSP in programs
This commit is contained in:
parent
09450f1455
commit
06e96d4ea9
23
tlib/src/ssp.cpp
Normal file
23
tlib/src/ssp.cpp
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
//=======================================================================
|
||||||
|
// Copyright Baptiste Wicht 2013-2016.
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
|
// http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
//=======================================================================
|
||||||
|
|
||||||
|
#include <print.hpp>
|
||||||
|
#include <system.hpp>
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
|
||||||
|
#define STACK_CHK_GUARD 0x595e9fbd94fda766
|
||||||
|
|
||||||
|
uintptr_t __stack_chk_guard = STACK_CHK_GUARD;
|
||||||
|
|
||||||
|
__attribute__((noreturn)) void __stack_chk_fail(){
|
||||||
|
printf("Stack smashing detected \n");
|
||||||
|
//TODO printf("pid=%u\n", scheduler::get_pid());
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user