aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel
diff options
context:
space:
mode:
authorAndy Lutomirski <luto@kernel.org>2019-11-21 11:50:12 +0100
committerPeter Zijlstra <peterz@infradead.org>2019-11-21 19:37:42 +0100
commit3580d0b29cab08483f84a16ce6a1151a1013695f (patch)
treebf5cd1540fe54bd1cb4a9e05355005f7676a32a2 /arch/x86/kernel
parentx86/xen/32: Simplify ring check in xen_iret_crit_fixup() (diff)
downloadlinux-dev-3580d0b29cab08483f84a16ce6a1151a1013695f.tar.xz
linux-dev-3580d0b29cab08483f84a16ce6a1151a1013695f.zip
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 <luto@kernel.org> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: stable@kernel.org
Diffstat (limited to 'arch/x86/kernel')
-rw-r--r--arch/x86/kernel/doublefault.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/x86/kernel/doublefault.c b/arch/x86/kernel/doublefault.c
index 0b8cedb20d6d..d5c9b13bafdf 100644
--- a/arch/x86/kernel/doublefault.c
+++ b/arch/x86/kernel/doublefault.c
@@ -65,6 +65,9 @@ struct x86_hw_tss doublefault_tss __cacheline_aligned = {
.ss = __KERNEL_DS,
.ds = __USER_DS,
.fs = __KERNEL_PERCPU,
+#ifndef CONFIG_X86_32_LAZY_GS
+ .gs = __KERNEL_STACK_CANARY,
+#endif
.__cr3 = __pa_nodebug(swapper_pg_dir),
};