diff options
author | Andrew Cooper <andrew.cooper3@citrix.com> | 2021-11-01 20:45:26 +0000 |
---|---|---|
committer | Andrew Cooper <andrew.cooper3@citrix.com> | 2021-11-03 13:08:42 +0000 |
commit | b2851580b1f2ff121737a37cb25a370d7692ae3b (patch) | |
tree | 858bbf61b6a3b4e166f9df2b0e8bf48c85dec020 /xen/include | |
parent | ce309942c791628ff42082d1b74bfaeaa5267ae0 (diff) |
x86/shstk: Fix use of shadow stacks with XPTI active
The call to setup_cpu_root_pgt(0) in smp_prepare_cpus() is too early. It
clones the BSP's stack while the .data mapping is still in use, causing all
mappings to be fully read read/write (and with no guard pages either). This
ultimately causes #DF when trying to enter the dom0 kernel for the first time.
Defer setting up BSPs XPTI pagetable until reinit_bsp_stack() after we've set
up proper shadow stack permissions.
Fixes: 60016604739b ("x86/shstk: Rework the stack layout to support shadow stacks")
Fixes: b60ab42db2f0 ("x86/shstk: Activate Supervisor Shadow Stacks")
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Release-Acked-by: Ian Jackson <iwj@xenproject.org>
Diffstat (limited to 'xen/include')
-rw-r--r-- | xen/include/xen/smp.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/xen/include/xen/smp.h b/xen/include/xen/smp.h index d5a3644611..0a9219173f 100644 --- a/xen/include/xen/smp.h +++ b/xen/include/xen/smp.h @@ -70,5 +70,6 @@ int alloc_cpu_id(void); extern void *stack_base[NR_CPUS]; void initialize_cpu_data(unsigned int cpu); +int setup_cpu_root_pgt(unsigned int cpu); #endif /* __XEN_SMP_H__ */ |