Re: [PATCH v1 3/3] KVM: s390: generalize kvm_s390_get_tod_clock_ext()

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

 




On 04/27/2018 02:36 PM, David Hildenbrand wrote:
> Move the Multiple-epoch facility handling into it and rename it to
[..]


> @@ -1055,13 +1057,7 @@ static int kvm_s390_get_tod_ext(struct kvm *kvm, struct kvm_device_attr *attr)
>  {
>  	struct kvm_s390_vm_tod_clock gtod;
>  
> -	memset(&gtod, 0, sizeof(gtod));

We should keep the memset, otherwise the padding might leak kernel info as we copy .
(found by smatch)


    arch/s390/kvm/kvm-s390.c:1068 kvm_s390_get_tod_ext() warn: check that 'gtod' doesn't leak information (struct has a hole after 'epoch_idx')


> -
> -	if (test_kvm_facility(kvm, 139))
> -		kvm_s390_get_tod_clock_ext(kvm, &gtod);
> -	else
> -		gtod.tod = kvm_s390_get_tod_clock_fast(kvm);
> -
> +	kvm_s390_get_tod_clock(kvm, &gtod);
>  	if (copy_to_user((void __user *)attr->addr, &gtod, sizeof(gtod)))
>  		return -EFAULT;
>  
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-s390" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[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