lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALCETrUsjMkQfwhwAvsJz0gNXaH-OOz0qCUJ5q1me3=4zpP7Ew@mail.gmail.com>
Date:	Tue, 15 Jul 2014 08:44:39 -0700
From:	Andy Lutomirski <luto@...capital.net>
To:	Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>
Cc:	"H. Peter Anvin" <hpa@...or.com>,
	Boris Ostrovsky <boris.ostrovsky@...cle.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	stable <stable@...r.kernel.org>
Subject: Re: [PATCH] x86_64,xen,espfix: Initialize espfix on secondary CPUs

On Tue, Jul 15, 2014 at 8:38 AM, Konrad Rzeszutek Wilk
<konrad.wilk@...cle.com> wrote:
> On Tue, Jul 15, 2014 at 08:26:41AM -0700, Andy Lutomirski wrote:
>> Xen doesn't call start_secondary.
>
> Duh!
>>
>> Cc: stable@...r.kernel.org
>> Signed-off-by: Andy Lutomirski <luto@...capital.net>
>> ---
>>
>> espfix still doesn't seem to work on Xen (it goes boom in some way that
>> I don't understand right now), but initializing all CPUs instead of just
>> one of them seems like a good start.
>>
>> ISTM the right fix is probably to shove the espfix logic into
>> native_iret and to tweak the paravirt logic so that native_iret always
>> gets invoked.  I suspect that Xen will need its own implementation of
>> espfix64 in the hypervisor and that, ultimately, someone may want to
>> stop initializing espfix64 at all on Xen guests.
>
> I think just disallowing would be preferrable.

Disabling what?

Sorry, my flu-addled brain needs more clarity.  I'm currently working
on a patch on top of this one to move all of the espfix64 invocation
logic into native_iret, which will have the effect of preventing it
from being used on Xen.

Is that what you mean?

--Andy

>
> Thanks for posting this patch!
>>
>>  arch/x86/xen/smp.c | 8 ++++++++
>>  1 file changed, 8 insertions(+)
>>
>> diff --git a/arch/x86/xen/smp.c b/arch/x86/xen/smp.c
>> index 7005974..eea9bcc 100644
>> --- a/arch/x86/xen/smp.c
>> +++ b/arch/x86/xen/smp.c
>> @@ -23,6 +23,7 @@
>>  #include <asm/desc.h>
>>  #include <asm/pgtable.h>
>>  #include <asm/cpu.h>
>> +#include <asm/espfix.h>
>>
>>  #include <xen/interface/xen.h>
>>  #include <xen/interface/vcpu.h>
>> @@ -85,6 +86,13 @@ static void cpu_bringup(void)
>>
>>       xen_setup_cpu_clockevents();
>>
>> +     /*
>> +      * Enable the espfix hack for this CPU
>> +      */
>> +#ifdef CONFIG_X86_ESPFIX64
>> +     init_espfix_ap();
>> +#endif
>> +
>>       notify_cpu_starting(cpu);
>>
>>       set_cpu_online(cpu, true);
>> --
>> 1.9.3
>>



-- 
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@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ