hc
2024-05-10 10ebd8556b7990499c896a550e3d416b444211e6
kernel/arch/arm64/include/asm/stackprotector.h
....@@ -15,6 +15,7 @@
1515
1616 #include <linux/random.h>
1717 #include <linux/version.h>
18
+#include <asm/pointer_auth.h>
1819
1920 extern unsigned long __stack_chk_guard;
2021
....@@ -26,6 +27,7 @@
2627 */
2728 static __always_inline void boot_init_stack_canary(void)
2829 {
30
+#if defined(CONFIG_STACKPROTECTOR)
2931 unsigned long canary;
3032
3133 /* Try to get a semi random initial value. */
....@@ -34,7 +36,12 @@
3436 canary &= CANARY_MASK;
3537
3638 current->stack_canary = canary;
37
- __stack_chk_guard = current->stack_canary;
39
+ if (!IS_ENABLED(CONFIG_STACKPROTECTOR_PER_TASK))
40
+ __stack_chk_guard = current->stack_canary;
41
+#endif
42
+ ptrauth_thread_init_kernel(current);
43
+ ptrauth_thread_switch_kernel(current);
44
+ ptrauth_enable();
3845 }
3946
4047 #endif /* _ASM_STACKPROTECTOR_H */