Skip to content

Commit 3580d0b

Browse files
amlutoPeter Zijlstra
authored andcommitted
x86/doublefault/32: Fix stack canaries in the double fault handler
The double fault TSS was missing GS setup, which is needed for stack canaries to work. Signed-off-by: Andy Lutomirski <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Cc: [email protected]
1 parent 922eea2 commit 3580d0b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

arch/x86/kernel/doublefault.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ struct x86_hw_tss doublefault_tss __cacheline_aligned = {
6565
.ss = __KERNEL_DS,
6666
.ds = __USER_DS,
6767
.fs = __KERNEL_PERCPU,
68+
#ifndef CONFIG_X86_32_LAZY_GS
69+
.gs = __KERNEL_STACK_CANARY,
70+
#endif
6871

6972
.__cr3 = __pa_nodebug(swapper_pg_dir),
7073
};

0 commit comments

Comments
 (0)