summaryrefslogtreecommitdiff
path: root/xen/arch/x86/smpboot.c
diff options
context:
space:
mode:
authorAndrew Cooper <andrew.cooper3@citrix.com>2020-04-23 20:20:59 +0100
committerAndrew Cooper <andrew.cooper3@citrix.com>2020-05-29 23:09:46 +0100
commit60016604739be61faf7196637739763d01a88a48 (patch)
tree257d0701ae9e2b1cf2f24ffa298dae08cd0377ed /xen/arch/x86/smpboot.c
parent5ad05b9c249060fb0f8e8afb9215b08f04579f17 (diff)
x86/shstk: Rework the stack layout to support shadow stacks
We have two free pages in the current stack. A useful property of shadow stacks and regular stacks is that they act as each others guard pages as far as OoB writes go. As wild OoB stack reads aren't likely, we don't lose any meaningful protection from using read-only guard pages in general (rather than non-present guard pages), but result is far simpler for Xen as a whole by not having a feature/mode dependent stack configuration. Move the regular IST stacks up by one page, to allow their shadow stack page to be in slot 0. The primary shadow stack uses slot 5. As the shadow IST stacks are only 1k large, shuffle the order of IST vectors to have #DF numerically highest, so there is no chance of a shadow stack overflow clobbering the supervisor token. The XPTI code already breaks the MEMORY_GUARD abstraction for stacks by forcing it to be in effect (i.e. guard page not present). To avoid having too many configurations, do away with the concept entirely, and unconditionally map the pages in their read-only form. A later change will turn these properly into shadow stacks. Some of the comments written here are the intended result, and will become true in the subsequent change. Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Diffstat (limited to 'xen/arch/x86/smpboot.c')
-rw-r--r--xen/arch/x86/smpboot.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/xen/arch/x86/smpboot.c b/xen/arch/x86/smpboot.c
index 170ab24e66..13b3dade9c 100644
--- a/xen/arch/x86/smpboot.c
+++ b/xen/arch/x86/smpboot.c
@@ -823,8 +823,7 @@ static int setup_cpu_root_pgt(unsigned int cpu)
/* Install direct map page table entries for stack, IDT, and TSS. */
for ( off = rc = 0; !rc && off < STACK_SIZE; off += PAGE_SIZE )
- if ( !memguard_is_stack_guard_page(off) )
- rc = clone_mapping(__va(__pa(stack_base[cpu])) + off, rpt);
+ rc = clone_mapping(__va(__pa(stack_base[cpu])) + off, rpt);
if ( !rc )
rc = clone_mapping(idt_tables[cpu], rpt);