Re: [PATCH v4 18/36] KVM: S390: protvirt: Introduce instruction data area bounce buffer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 25.02.20 18:19, Cornelia Huck wrote:
> On Mon, 24 Feb 2020 06:40:49 -0500
> Christian Borntraeger <borntraeger@xxxxxxxxxx> wrote:
> 
>> From: Janosch Frank <frankja@xxxxxxxxxxxxx>
>>
>> Now that we can't access guest memory anymore, we have a dedicated
>> satellite block that's a bounce buffer for instruction data.
>>
>> We re-use the memop interface to copy the instruction data to / from
>> userspace. This lets us re-use a lot of QEMU code which used that
>> interface to make logical guest memory accesses which are not possible
>> anymore in protected mode anyway.
>>
>> Signed-off-by: Janosch Frank <frankja@xxxxxxxxxxxxx>
>> Reviewed-by: Thomas Huth <thuth@xxxxxxxxxx>
>> [borntraeger@xxxxxxxxxx: patch merging, splitting, fixing]
>> Signed-off-by: Christian Borntraeger <borntraeger@xxxxxxxxxx>
>> ---
>>  arch/s390/include/asm/kvm_host.h | 11 +++++-
>>  arch/s390/kvm/kvm-s390.c         | 65 ++++++++++++++++++++++++++++----
>>  arch/s390/kvm/pv.c               | 11 ++++++
>>  include/uapi/linux/kvm.h         |  9 ++++-
>>  4 files changed, 85 insertions(+), 11 deletions(-)
>>
> 
> (...)
> 
>> @@ -4512,8 +4540,8 @@ static long kvm_s390_guest_mem_op(struct kvm_vcpu *vcpu,
>>  		if (!tmpbuf)
>>  			return -ENOMEM;
>>  	}
>> -
>> -	srcu_idx = srcu_read_lock(&vcpu->kvm->srcu);
>> +	if (kvm_s390_pv_cpu_is_protected(vcpu))
>> +		return -EINVAL;
> 
> Doesn't that leak tmpbuf (allocated right above)? Maybe just move that
> check up?

nice catch. Fixed.




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Kernel Development]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Info]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Linux Media]     [Device Mapper]

  Powered by Linux