gdt-A20

导航

start_kernel---boot_init_stack_canary<四>

In init/main.c

1 /*
2 * Set up the the initial canary ASAP:
3 */
4 boot_init_stack_canary();

in arch/arm/include/asm/stackprotector.h

 1 /*
2 * Initialize the stackprotector canary value.
3 *
4 * NOTE: this must only be called from functions that never return,
5 * and it must always be inlined.
6 */
7 static __always_inline void boot_init_stack_canary(void)
8 {
9 unsigned long canary;
10
11 /* Try to get a semi random initial value. */
12 get_random_bytes(&canary, sizeof(canary));
13 canary ^= LINUX_VERSION_CODE;
14
15 current->stack_canary = canary;
16 __stack_chk_guard = current->stack_canary;
17 }

得到随机数字&kernel version,用于版本检测?



 

posted on 2012-01-15 23:14  gdt-A20  阅读(1351)  评论(0编辑  收藏  举报