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,用于版本检测?



 

相关文章:

  • 2021-12-25
  • 2021-09-08
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-14
  • 2021-08-20
猜你喜欢
  • 2022-12-23
  • 2021-09-06
  • 2021-05-25
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案