Re: [PATCH v2 07/10] x86/entry: Vastly simplify SYSENTER TF handling

2016-03-07 Thread Andy Lutomirski
On Mon, Mar 7, 2016 at 10:41 AM, Brian Gerst wrote: > On Mon, Mar 7, 2016 at 1:03 PM, Andy Lutomirski wrote: >> On Mon, Mar 7, 2016 at 9:17 AM, Brian Gerst wrote: >>> On Sun, Mar 6, 2016 at 12:52 AM, Andy Lutomirski

Re: [PATCH v2 07/10] x86/entry: Vastly simplify SYSENTER TF handling

2016-03-07 Thread Andy Lutomirski
On Mon, Mar 7, 2016 at 10:41 AM, Brian Gerst wrote: > On Mon, Mar 7, 2016 at 1:03 PM, Andy Lutomirski wrote: >> On Mon, Mar 7, 2016 at 9:17 AM, Brian Gerst wrote: >>> On Sun, Mar 6, 2016 at 12:52 AM, Andy Lutomirski wrote: Due to a blatant design error, SYSENTER doesn't clear TF. As a

Re: [PATCH v2 07/10] x86/entry: Vastly simplify SYSENTER TF handling

2016-03-07 Thread Brian Gerst
On Mon, Mar 7, 2016 at 1:03 PM, Andy Lutomirski wrote: > On Mon, Mar 7, 2016 at 9:17 AM, Brian Gerst wrote: >> On Sun, Mar 6, 2016 at 12:52 AM, Andy Lutomirski wrote: >>> Due to a blatant design error, SYSENTER doesn't clear TF. As a

Re: [PATCH v2 07/10] x86/entry: Vastly simplify SYSENTER TF handling

2016-03-07 Thread Brian Gerst
On Mon, Mar 7, 2016 at 1:03 PM, Andy Lutomirski wrote: > On Mon, Mar 7, 2016 at 9:17 AM, Brian Gerst wrote: >> On Sun, Mar 6, 2016 at 12:52 AM, Andy Lutomirski wrote: >>> Due to a blatant design error, SYSENTER doesn't clear TF. As a result, >>> if a user does SYSENTER with TF set, we will

Re: [PATCH v2 07/10] x86/entry: Vastly simplify SYSENTER TF handling

2016-03-07 Thread Andy Lutomirski
On Mon, Mar 7, 2016 at 9:17 AM, Brian Gerst wrote: > On Sun, Mar 6, 2016 at 12:52 AM, Andy Lutomirski wrote: >> Due to a blatant design error, SYSENTER doesn't clear TF. As a result, >> if a user does SYSENTER with TF set, we will single-step through the >>

Re: [PATCH v2 07/10] x86/entry: Vastly simplify SYSENTER TF handling

2016-03-07 Thread Andy Lutomirski
On Mon, Mar 7, 2016 at 9:17 AM, Brian Gerst wrote: > On Sun, Mar 6, 2016 at 12:52 AM, Andy Lutomirski wrote: >> Due to a blatant design error, SYSENTER doesn't clear TF. As a result, >> if a user does SYSENTER with TF set, we will single-step through the >> kernel until something clears TF.

Re: [PATCH v2 07/10] x86/entry: Vastly simplify SYSENTER TF handling

2016-03-07 Thread Brian Gerst
On Sun, Mar 6, 2016 at 12:52 AM, Andy Lutomirski wrote: > Due to a blatant design error, SYSENTER doesn't clear TF. As a result, > if a user does SYSENTER with TF set, we will single-step through the > kernel until something clears TF. There is absolutely nothing we can > do to

Re: [PATCH v2 07/10] x86/entry: Vastly simplify SYSENTER TF handling

2016-03-07 Thread Brian Gerst
On Sun, Mar 6, 2016 at 12:52 AM, Andy Lutomirski wrote: > Due to a blatant design error, SYSENTER doesn't clear TF. As a result, > if a user does SYSENTER with TF set, we will single-step through the > kernel until something clears TF. There is absolutely nothing we can > do to prevent this

Re: [PATCH v2 07/10] x86/entry: Vastly simplify SYSENTER TF handling

2016-03-06 Thread Andrew Cooper
On 06/03/16 17:36, Andy Lutomirski wrote: > >> I haven't read the Xen hypervisor code, but what are those 5 words >> that were pushed on the stack by the hypervisor? It suspiciously is >> the size of an IRET frame. > I think it is nominally an IRET frame. It is a notminal IRET frame. Even to

Re: [PATCH v2 07/10] x86/entry: Vastly simplify SYSENTER TF handling

2016-03-06 Thread Andrew Cooper
On 06/03/16 17:36, Andy Lutomirski wrote: > >> I haven't read the Xen hypervisor code, but what are those 5 words >> that were pushed on the stack by the hypervisor? It suspiciously is >> the size of an IRET frame. > I think it is nominally an IRET frame. It is a notminal IRET frame. Even to

Re: [PATCH v2 07/10] x86/entry: Vastly simplify SYSENTER TF handling

2016-03-06 Thread Borislav Petkov
On Sun, Mar 06, 2016 at 09:36:42AM -0800, Andy Lutomirski wrote: > > ALTERNATIVE "movl TSS_sysenter_sp0(%esp), %esp", "addl $5*4, %esp", > > X86_FEATURE_XENPV > > That might work. Yap, and as we said on IRC, KALLSYMS can be off - even if it is "if EXPERT" so we need to think of a better way to

Re: [PATCH v2 07/10] x86/entry: Vastly simplify SYSENTER TF handling

2016-03-06 Thread Borislav Petkov
On Sun, Mar 06, 2016 at 09:36:42AM -0800, Andy Lutomirski wrote: > > ALTERNATIVE "movl TSS_sysenter_sp0(%esp), %esp", "addl $5*4, %esp", > > X86_FEATURE_XENPV > > That might work. Yap, and as we said on IRC, KALLSYMS can be off - even if it is "if EXPERT" so we need to think of a better way to

Re: [PATCH v2 07/10] x86/entry: Vastly simplify SYSENTER TF handling

2016-03-06 Thread Andy Lutomirski
On Sun, Mar 6, 2016 at 9:30 AM, Brian Gerst wrote: > On Sun, Mar 6, 2016 at 11:55 AM, Borislav Petkov wrote: >> On Sat, Mar 05, 2016 at 09:52:20PM -0800, Andy Lutomirski wrote: >>> Due to a blatant design error, SYSENTER doesn't clear TF. As a result, >>> if a

Re: [PATCH v2 07/10] x86/entry: Vastly simplify SYSENTER TF handling

2016-03-06 Thread Andy Lutomirski
On Sun, Mar 6, 2016 at 9:30 AM, Brian Gerst wrote: > On Sun, Mar 6, 2016 at 11:55 AM, Borislav Petkov wrote: >> On Sat, Mar 05, 2016 at 09:52:20PM -0800, Andy Lutomirski wrote: >>> Due to a blatant design error, SYSENTER doesn't clear TF. As a result, >>> if a user does SYSENTER with TF set, we

Re: [PATCH v2 07/10] x86/entry: Vastly simplify SYSENTER TF handling

2016-03-06 Thread Brian Gerst
On Sun, Mar 6, 2016 at 11:55 AM, Borislav Petkov wrote: > On Sat, Mar 05, 2016 at 09:52:20PM -0800, Andy Lutomirski wrote: >> Due to a blatant design error, SYSENTER doesn't clear TF. As a result, >> if a user does SYSENTER with TF set, we will single-step through the >> kernel

Re: [PATCH v2 07/10] x86/entry: Vastly simplify SYSENTER TF handling

2016-03-06 Thread Brian Gerst
On Sun, Mar 6, 2016 at 11:55 AM, Borislav Petkov wrote: > On Sat, Mar 05, 2016 at 09:52:20PM -0800, Andy Lutomirski wrote: >> Due to a blatant design error, SYSENTER doesn't clear TF. As a result, >> if a user does SYSENTER with TF set, we will single-step through the >> kernel until something

Re: [PATCH v2 07/10] x86/entry: Vastly simplify SYSENTER TF handling

2016-03-06 Thread Borislav Petkov
On Sat, Mar 05, 2016 at 09:52:20PM -0800, Andy Lutomirski wrote: > Due to a blatant design error, SYSENTER doesn't clear TF. As a result, > if a user does SYSENTER with TF set, we will single-step through the > kernel until something clears TF. There is absolutely nothing we can > do to prevent

Re: [PATCH v2 07/10] x86/entry: Vastly simplify SYSENTER TF handling

2016-03-06 Thread Borislav Petkov
On Sat, Mar 05, 2016 at 09:52:20PM -0800, Andy Lutomirski wrote: > Due to a blatant design error, SYSENTER doesn't clear TF. As a result, > if a user does SYSENTER with TF set, we will single-step through the > kernel until something clears TF. There is absolutely nothing we can > do to prevent