Commit 2c212e1b authored by Janis Schoetterl-Glausch's avatar Janis Schoetterl-Glausch Committed by Christian Borntraeger

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: 19e12277 (KVM: S390: protvirt: Introduce instruction data area bounce buffer)
Signed-off-by: default avatarJanis Schoetterl-Glausch <scgl@linux.ibm.com>
Cc: stable@vger.kernel.org
Signed-off-by: default avatarChristian Borntraeger <borntraeger@linux.ibm.com>
parent 9f7fb8de
...@@ -4667,6 +4667,8 @@ static long kvm_s390_guest_sida_op(struct kvm_vcpu *vcpu, ...@@ -4667,6 +4667,8 @@ static long kvm_s390_guest_sida_op(struct kvm_vcpu *vcpu,
return -EINVAL; return -EINVAL;
if (mop->size + mop->sida_offset > sida_size(vcpu->arch.sie_block)) if (mop->size + mop->sida_offset > sida_size(vcpu->arch.sie_block))
return -E2BIG; return -E2BIG;
if (!kvm_s390_pv_cpu_is_protected(vcpu))
return -EINVAL;
switch (mop->op) { switch (mop->op) {
case KVM_S390_MEMOP_SIDA_READ: case KVM_S390_MEMOP_SIDA_READ:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment