Skip to content

Commit 880a98c

Browse files
KAGA-KOKOPeter Zijlstra
authored andcommitted
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: c482fee ("x86/entry/64: Make cpu_entry_area.tss read-only") Signed-off-by: Thomas Gleixner <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Cc: [email protected]
1 parent f490e07 commit 880a98c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

arch/x86/include/asm/cpu_entry_area.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,12 @@ struct cpu_entry_area {
7878

7979
/*
8080
* The GDT is just below entry_stack and thus serves (on x86_64) as
81-
* a a read-only guard page.
81+
* a read-only guard page. On 32-bit the GDT must be writeable, so
82+
* it needs an extra guard page.
8283
*/
84+
#ifdef CONFIG_X86_32
85+
char guard_entry_stack[PAGE_SIZE];
86+
#endif
8387
struct entry_stack_page entry_stack_page;
8488

8589
/*

0 commit comments

Comments
 (0)