diff options
author | Janis Schoetterl-Glausch <scgl@linux.ibm.com> | 2022-01-28 15:06:43 +0100 |
---|---|---|
committer | Christian Borntraeger <borntraeger@linux.ibm.com> | 2022-02-02 10:02:00 +0100 |
commit | 2c212e1baedcd782b2535a3f86bc491977677c0e (patch) | |
tree | 686c763a0a2f91f34cd9f510ccf8df1c5ebed1b8 /arch/s390/kvm | |
parent | 9f7fb8de5d9bac17b6392a14af40baf555d9129b (diff) | |
download | linux-2c212e1baedcd782b2535a3f86bc491977677c0e.tar.gz linux-2c212e1baedcd782b2535a3f86bc491977677c0e.tar.bz2 linux-2c212e1baedcd782b2535a3f86bc491977677c0e.zip |
KVM: s390: Return error on SIDA memop on normal guest
Refuse SIDA memops on guests which are not protected.
For normal guests, the secure instruction data address designation,
which determines the location we access, is not under control of KVM.
Fixes: 19e122776886 (KVM: S390: protvirt: Introduce instruction data area bounce buffer)
Signed-off-by: Janis Schoetterl-Glausch <scgl@linux.ibm.com>
Cc: stable@vger.kernel.org
Signed-off-by: Christian Borntraeger <borntraeger@linux.ibm.com>
Diffstat (limited to 'arch/s390/kvm')
-rw-r--r-- | arch/s390/kvm/kvm-s390.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c index 577f1ead6a51..2296b1ff1e02 100644 --- a/arch/s390/kvm/kvm-s390.c +++ b/arch/s390/kvm/kvm-s390.c @@ -4667,6 +4667,8 @@ static long kvm_s390_guest_sida_op(struct kvm_vcpu *vcpu, return -EINVAL; if (mop->size + mop->sida_offset > sida_size(vcpu->arch.sie_block)) return -E2BIG; + if (!kvm_s390_pv_cpu_is_protected(vcpu)) + return -EINVAL; switch (mop->op) { case KVM_S390_MEMOP_SIDA_READ: |