2 #define FAST_FAIL_STACK_COOKIE_CHECK_FAILURE 2
4 /* Should be random :-/ */
5 void * __stack_chk_guard
= (void*)0xf00df00d;
8 void __stack_chk_guard_setup()
11 p
= (unsigned char *)&__stack_chk_guard
; // *** Notice that this takes the address of __stack_chk_guard ***
13 /* If you have the ability to generate random numbers in your kernel then use them,
14 otherwise for 32-bit code: */
15 *p
= 0x00000aff; // *** p is &__stack_chk_guard so *p writes to __stack_chk_guard rather than *__stack_chk_guard ***
19 void __stack_chk_fail()
22 __asm__("int $0x29" : : "c"(FAST_FAIL_STACK_COOKIE_CHECK_FAILURE
) : "memory");