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] [day] [month] [year] [list]
Date:	Fri, 4 Mar 2016 14:27:03 +0100
From:	Radim Krčmář <rkrcmar@...hat.com>
To:	David Matlack <dmatlack@...gle.com>
Cc:	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	kvm list <kvm@...r.kernel.org>,
	Paolo Bonzini <pbonzini@...hat.com>,
	Jiří Olša <jolsa@...hat.com>,
	stable@...r.kernel.org
Subject: Re: [PATCH] KVM: x86: disable PEBS before a guest entry

2016-03-03 13:32-0800, David Matlack:
> On Thu, Mar 3, 2016 at 10:53 AM, Radim Krčmář <rkrcmar@...hat.com> wrote:
>> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
>> @@ -1767,6 +1767,13 @@ static void clear_atomic_switch_msr(struct vcpu_vmx *vmx, unsigned msr)
>>                         return;
>>                 }
>>                 break;
>> +       case MSR_IA32_PEBS_ENABLE:
>> +               /* PEBS needs a quiescent period after being disabled (to write
>> +                * a record).  Disabling PEBS through VMX MSR swapping doesn't
>> +                * provide that period, so a CPU could write host's record into
>> +                * guest's memory.
>> +                */
>> +               wrmsrl(MSR_IA32_PEBS_ENABLE, 0);
> 
> Should this go in add_atomic_switch_msr instead of clear_atomic_switch_msr?

Yes, it could be cleared in both (in case guest PEBS can be non-zero),
but I wanted to have it only in add_atomic_switch_msr().

Thank you!

v2 underway.

(In case it makes you wonder how it was tested:
 I have a bad habit of trying whether a patch can be improved before
 posting and this one went awry, because I already returned the machine
 with reproducer and the change seemed simple enough.)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ