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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5130734F.6090208@suse.cz>
Date:	Fri, 01 Mar 2013 10:22:23 +0100
From:	Jiri Slaby <jslaby@...e.cz>
To:	Christian Borntraeger <borntraeger@...ibm.com>
CC:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	linux-kernel@...r.kernel.org, stable@...r.kernel.org,
	Gleb Natapov <gleb@...hat.com>
Subject: Re: [ 17/53] s390/kvm: Fix store status for ACRS/FPRS

On 03/01/2013 08:50 AM, Christian Borntraeger wrote:
> On 28/02/13 23:26, Jiri Slaby wrote:
>> On 02/27/2013 12:57 AM, Greg Kroah-Hartman wrote:
>>> 3.0-stable review patch.  If anyone has any objections, please let me know.
>>>
>>> ------------------
>>>
>>> From: Christian Borntraeger <borntraeger@...ibm.com>
>>>
>>> commit 15bc8d8457875f495c59d933b05770ba88d1eacb upstream.
>>>
>>> On store status we need to copy the current state of registers
>>> into a save area. Currently we might save stale versions:
>>> The sie state descriptor doesnt have fields for guest ACRS,FPRS,
>>> those registers are simply stored in the host registers. The host
>>> program must copy these away if needed. We do that in vcpu_put/load.
>>>
>>> If we now do a store status in KVM code between vcpu_put/load, the
>>> saved values are not up-to-date. Lets collect the ACRS/FPRS before
>>> saving them.
>>>
>>> This also fixes some strange problems with hotplug and virtio-ccw,
>>> since the low level machine check handler (on hotplug a machine check
>>> will happen) will revalidate all registers with the content of the
>>> save area.
>>>
>>> Signed-off-by: Christian Borntraeger <borntraeger@...ibm.com>
>>> Signed-off-by: Gleb Natapov <gleb@...hat.com>
>>> Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
>>>
>>> ---
>>>  arch/s390/kvm/kvm-s390.c |    8 ++++++++
>>>  1 file changed, 8 insertions(+)
>>>
>>> --- a/arch/s390/kvm/kvm-s390.c
>>> +++ b/arch/s390/kvm/kvm-s390.c
>>> @@ -584,6 +584,14 @@ int kvm_s390_vcpu_store_status(struct kv
>>>  	} else
>>>  		prefix = 0;
>>>  
>>> +	/*
>>> +	 * The guest FPRS and ACRS are in the host FPRS/ACRS due to the lazy
>>> +	 * copying in vcpu load/put. Lets update our copies before we save
>>> +	 * it into the save area
>>> +	 */
>>> +	save_fp_regs(&vcpu->arch.guest_fpregs);
>>> +	save_access_regs(vcpu->run->s.regs.acrs);
>>
>> kvm_run structure does not have kvm_sync_regs in it in 3.0 yet. So this
>> fails with:
>> arch/s390/kvm/kvm-s390.c: In function 'kvm_s390_vcpu_store_status':
>> arch/s390/kvm/kvm-s390.c:593: error: 'struct kvm_run' has no member
>> named 's'
>>
>> I believe the fix is just to remove save_access_regs, right?
> 
> Before the sync reg changes, the ACRS were saved in the vcpu->arch.
> So the fix would look like 
> 
> 	save_access_regs(vcpu->arch.guest_acrs);

Fix attached.

thanks,
-- 
js
suse labs

View attachment "s390-kvm-Fix-store-status-for-ACRS-FPRS-fix.patch" of type "text/x-patch" (1136 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ