]> xenbits.xensource.com Git - xen.git/commit
x86/entry: Make syscall/sysenter entrypoints CET-IBT compatible
authorAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 1 Nov 2021 09:51:16 +0000 (09:51 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 23 Feb 2022 15:33:43 +0000 (15:33 +0000)
commit17d77ec62a299f4299883ec79ab10cacafd0b2f5
treeb1d69cc9b0cbe4d69cf8fc2ed1736788aebeffa6
parent0d101568d29e8b4bfd33f20031fedec2652aa0cf
x86/entry: Make syscall/sysenter entrypoints CET-IBT compatible

Each of MSR_{L,C}STAR and MSR_SYSENTER_EIP need to land on an endbr64
instruction.  For sysenter, this is easy.

Unfortunately for syscall, the stubs are already 29 byte long with a limit of
32.  endbr64 is 4 bytes.  Luckily, there is a 1 byte instruction which can
move from the stubs into the main handlers.

Move the push %rax out of the stub and into {l,c}star_entry(), allowing room
for the endbr64 instruction when appropriate.  Update the comment describing
the entry state.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/x86_64/entry.S
xen/arch/x86/x86_64/traps.c