Re: [PATCH] x86_64,xen,espfix: Initialize espfix on secondary CPUs

From: Andy Lutomirski
Date: Tue Jul 15 2014 - 12:00:47 EST

On Tue, Jul 15, 2014 at 8:50 AM, H. Peter Anvin <hpa@xxxxxxxxx> wrote:
> On 07/15/2014 08:38 AM, Konrad Rzeszutek Wilk wrote:
>> I think just disallowing would be preferrable.
> So I have yet to hear anyone talk about what the Xen PV IRET does for
> 16-bit stack segments. Can we get the answer for that, please?

If I'm reading the right thing, it does:

59 .Lforce_iret:
60 /* Mimic SYSRET behavior. */
61 movq 8(%rsp),%rcx # RIP
62 movq 24(%rsp),%r11 # RFLAGS
64 /* No special register assumptions. */
65 iret_exit_to_guest:
66 addq $8,%rsp
67 .Lft0: iretq

while running on Xen's stack. IOW, it leaks bits 31:16 of the Xen
stack, and there's nothing the guest can do about it short of using a
user-mode trampoline or disabling 16-bit stack segments entirely.


and (search for do_iret):;a=blob;f=xen/arch/x86/traps.c;h=677074b4e628ed99d407b1045d859355e590d604;hb=HEAD

> -hpa

Andy Lutomirski
AMA Capital Management, LLC
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at