On 02.05.2018 21:40, David Hildenbrand wrote: > On 02.05.2018 21:36, Christian Borntraeger wrote: >> >> >> 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(>od, 0, sizeof(gtod)); >> >> We should keep the memset, otherwise the padding might leak kernel info as we copy . >> (found by smatch) > > Thanks for the info and running the checker. > > @Janosch please tell me if I should resend! I'll fix that, no need to resend. > >> >> >> 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, >od); >>> - else >>> - gtod.tod = kvm_s390_get_tod_clock_fast(kvm); >>> - >>> + kvm_s390_get_tod_clock(kvm, >od); >>> if (copy_to_user((void __user *)attr->addr, >od, sizeof(gtod))) >>> return -EFAULT; >>> >>> >> > >
Attachment:
signature.asc
Description: OpenPGP digital signature