diff options
author | Radim Krčmář <rkrcmar@redhat.com> | 2017-01-20 17:59:02 +0100 |
---|---|---|
committer | Radim Krčmář <rkrcmar@redhat.com> | 2017-01-20 17:59:02 +0100 |
commit | fec969012314ec452620516f8251f512f9b534ac (patch) | |
tree | acbb1dfa48480a81ca6672ac03fbf4d7c06b4121 /arch | |
parent | ce2e852ecc9a42e4b8dabb46025cfef63209234a (diff) | |
parent | 04478197416e3a302e9ebc917ba1aa884ef9bfab (diff) | |
download | linux-fec969012314ec452620516f8251f512f9b534ac.tar.gz linux-fec969012314ec452620516f8251f512f9b534ac.tar.bz2 linux-fec969012314ec452620516f8251f512f9b534ac.zip |
Merge tag 'kvm-s390-master-4.10-1' of git://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux
KVM: s390: Fix for 4.10 (via kvm/master)
Fix a kernel memory exposure.
Diffstat (limited to 'arch')
-rw-r--r-- | arch/s390/kvm/kvm-s390.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c index bec71e902be3..6484a250021e 100644 --- a/arch/s390/kvm/kvm-s390.c +++ b/arch/s390/kvm/kvm-s390.c @@ -916,7 +916,7 @@ static int kvm_s390_get_machine(struct kvm *kvm, struct kvm_device_attr *attr) memcpy(&mach->fac_mask, kvm->arch.model.fac_mask, S390_ARCH_FAC_LIST_SIZE_BYTE); memcpy((unsigned long *)&mach->fac_list, S390_lowcore.stfle_fac_list, - S390_ARCH_FAC_LIST_SIZE_BYTE); + sizeof(S390_lowcore.stfle_fac_list)); if (copy_to_user((void __user *)attr->addr, mach, sizeof(*mach))) ret = -EFAULT; kfree(mach); @@ -1437,7 +1437,7 @@ int kvm_arch_init_vm(struct kvm *kvm, unsigned long type) /* Populate the facility mask initially. */ memcpy(kvm->arch.model.fac_mask, S390_lowcore.stfle_fac_list, - S390_ARCH_FAC_LIST_SIZE_BYTE); + sizeof(S390_lowcore.stfle_fac_list)); for (i = 0; i < S390_ARCH_FAC_LIST_SIZE_U64; i++) { if (i < kvm_s390_fac_list_mask_size()) kvm->arch.model.fac_mask[i] &= kvm_s390_fac_list_mask[i]; |