diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2019-11-21 00:40:24 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-11-29 10:08:05 +0100 |
commit | df0b94fb0696a6f507cd493f1574fc058b5d095c (patch) | |
tree | e86fba959c4f76f3bd20d7153a9ca172bcf3d7c9 /arch/x86 | |
parent | 7518035301de19eab2e44ec0bfed31d3db7d7128 (diff) | |
download | linux-stable-df0b94fb0696a6f507cd493f1574fc058b5d095c.tar.gz linux-stable-df0b94fb0696a6f507cd493f1574fc058b5d095c.tar.bz2 linux-stable-df0b94fb0696a6f507cd493f1574fc058b5d095c.zip |
x86/cpu_entry_area: Add guard page for entry stack on 32bit
commit 880a98c339961eaa074393e3a2117cbe9125b8bb upstream.
The entry stack in the cpu entry area is protected against overflow by the
readonly GDT on 64-bit, but on 32-bit the GDT needs to be writeable and
therefore does not trigger a fault on stack overflow.
Add a guard page.
Fixes: c482feefe1ae ("x86/entry/64: Make cpu_entry_area.tss read-only")
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: stable@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/include/asm/cpu_entry_area.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/x86/include/asm/cpu_entry_area.h b/arch/x86/include/asm/cpu_entry_area.h index cff3f3f3bfe0..db23c95e796b 100644 --- a/arch/x86/include/asm/cpu_entry_area.h +++ b/arch/x86/include/asm/cpu_entry_area.h @@ -78,8 +78,12 @@ struct cpu_entry_area { /* * The GDT is just below entry_stack and thus serves (on x86_64) as - * a a read-only guard page. + * a read-only guard page. On 32-bit the GDT must be writeable, so + * it needs an extra guard page. */ +#ifdef CONFIG_X86_32 + char guard_entry_stack[PAGE_SIZE]; +#endif struct entry_stack_page entry_stack_page; /* |