This source file includes following definitions.
- boot_init_stack_canary
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 #ifndef _ASM_STACKPROTECTOR_H
16 #define _ASM_STACKPROTECTOR_H 1
17
18 #include <linux/random.h>
19 #include <linux/version.h>
20
21 #include <asm/thread_info.h>
22
23 extern unsigned long __stack_chk_guard;
24
25
26
27
28
29
30
31 static __always_inline void boot_init_stack_canary(void)
32 {
33 unsigned long canary;
34
35
36 get_random_bytes(&canary, sizeof(canary));
37 canary ^= LINUX_VERSION_CODE;
38
39 current->stack_canary = canary;
40 #ifndef CONFIG_STACKPROTECTOR_PER_TASK
41 __stack_chk_guard = current->stack_canary;
42 #else
43 current_thread_info()->stack_canary = current->stack_canary;
44 #endif
45 }
46
47 #endif