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