Skip to content

Commit a9c20bb

Browse files
committed
Merge tag 'kvm-s390-master-5.3-1' of git://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux into kvm-master
KVM: s390: Fixes for 5.3 - prevent a user triggerable oops in the migration code - do not leak kernel stack content
2 parents 002c5f7 + 53936b5 commit a9c20bb

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

arch/s390/kvm/interrupt.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1961,6 +1961,16 @@ int s390int_to_s390irq(struct kvm_s390_interrupt *s390int,
19611961
case KVM_S390_MCHK:
19621962
irq->u.mchk.mcic = s390int->parm64;
19631963
break;
1964+
case KVM_S390_INT_PFAULT_INIT:
1965+
irq->u.ext.ext_params = s390int->parm;
1966+
irq->u.ext.ext_params2 = s390int->parm64;
1967+
break;
1968+
case KVM_S390_RESTART:
1969+
case KVM_S390_INT_CLOCK_COMP:
1970+
case KVM_S390_INT_CPU_TIMER:
1971+
break;
1972+
default:
1973+
return -EINVAL;
19641974
}
19651975
return 0;
19661976
}

arch/s390/kvm/kvm-s390.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1018,6 +1018,8 @@ static int kvm_s390_vm_start_migration(struct kvm *kvm)
10181018
/* mark all the pages in active slots as dirty */
10191019
for (slotnr = 0; slotnr < slots->used_slots; slotnr++) {
10201020
ms = slots->memslots + slotnr;
1021+
if (!ms->dirty_bitmap)
1022+
return -EINVAL;
10211023
/*
10221024
* The second half of the bitmap is only used on x86,
10231025
* and would be wasted otherwise, so we put it to good
@@ -4323,7 +4325,7 @@ long kvm_arch_vcpu_async_ioctl(struct file *filp,
43234325
}
43244326
case KVM_S390_INTERRUPT: {
43254327
struct kvm_s390_interrupt s390int;
4326-
struct kvm_s390_irq s390irq;
4328+
struct kvm_s390_irq s390irq = {};
43274329

43284330
if (copy_from_user(&s390int, argp, sizeof(s390int)))
43294331
return -EFAULT;

0 commit comments

Comments
 (0)