Commit a64a6d23 authored by Halil Pasic's avatar Halil Pasic Committed by Heiko Carstens

s390: vfio-ap: tighten the NIB validity check

The NIB is architecturally invalid if the address designates a
storage location that is not installed or if it is zero.
Signed-off-by: default avatarHalil Pasic <pasic@linux.ibm.com>
Reported-by: default avatarJanosch Frank <frankja@linux.ibm.com>
Fixes: ec89b55e ("s390: ap: implement PAPQ AQIC interception in kernel")
Reviewed-by: default avatarTony Krowiak <akrowiak@linux.ibm.com>
Reviewed-by: default avatarPierre Morel <pmorel@linux.ibm.com>
Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
parent 2f09c2ea
...@@ -352,6 +352,8 @@ static int vfio_ap_validate_nib(struct kvm_vcpu *vcpu, dma_addr_t *nib) ...@@ -352,6 +352,8 @@ static int vfio_ap_validate_nib(struct kvm_vcpu *vcpu, dma_addr_t *nib)
{ {
*nib = vcpu->run->s.regs.gprs[2]; *nib = vcpu->run->s.regs.gprs[2];
if (!*nib)
return -EINVAL;
if (kvm_is_error_hva(gfn_to_hva(vcpu->kvm, *nib >> PAGE_SHIFT))) if (kvm_is_error_hva(gfn_to_hva(vcpu->kvm, *nib >> PAGE_SHIFT)))
return -EINVAL; return -EINVAL;
......
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