linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [tip: x86/urgent] x86/cpu_entry_area: Add guard page for entry stack on 32bit
@ 2019-11-21 20:14 tip-bot2 for Thomas Gleixner
  0 siblings, 0 replies; only message in thread
From: tip-bot2 for Thomas Gleixner @ 2019-11-21 20:14 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Thomas Gleixner, Peter Zijlstra (Intel), stable, x86, LKML

The following commit has been merged into the x86/urgent branch of tip:

Commit-ID:     880a98c339961eaa074393e3a2117cbe9125b8bb
Gitweb:        https://git.kernel.org/tip/880a98c339961eaa074393e3a2117cbe9125b8bb
Author:        Thomas Gleixner <tglx@linutronix.de>
AuthorDate:    Thu, 21 Nov 2019 00:40:24 +01:00
Committer:     Peter Zijlstra <peterz@infradead.org>
CommitterDate: Thu, 21 Nov 2019 19:37:43 +01:00

x86/cpu_entry_area: Add guard page for entry stack on 32bit

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
---
 arch/x86/include/asm/cpu_entry_area.h | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/arch/x86/include/asm/cpu_entry_area.h b/arch/x86/include/asm/cpu_entry_area.h
index 8348f7d..905d89c 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;
 
 	/*

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2019-11-21 20:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-21 20:14 [tip: x86/urgent] x86/cpu_entry_area: Add guard page for entry stack on 32bit tip-bot2 for Thomas Gleixner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).