]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
x86/doublefault/32: Fix stack canaries in the double fault handler
authorAndy Lutomirski <luto@kernel.org>
Thu, 21 Nov 2019 10:50:12 +0000 (11:50 +0100)
committerMarcelo Henrique Cerri <marcelo.cerri@canonical.com>
Fri, 17 Jan 2020 17:22:24 +0000 (14:22 -0300)
BugLink: https://bugs.launchpad.net/bugs/1854861
commit 3580d0b29cab08483f84a16ce6a1151a1013695f upstream.

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
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Connor Kuehl <connor.kuehl@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
arch/x86/kernel/doublefault.c

index 0b8cedb20d6d92f2875a49292680c8cfecd5b044..d5c9b13bafdf747836ae2cc62100b0b383359090 100644 (file)
@@ -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),
 };