This is a note to let you know that I've just added the patch titled s390: vfio-ap: tighten the NIB validity check to the 6.1-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: s390-vfio-ap-tighten-the-nib-validity-check.patch and it can be found in the queue-6.1 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit b1326d335d8346cd3dcf4b85ef95beae9a431d97 Author: Halil Pasic <pasic@xxxxxxxxxxxxx> Date: Thu Feb 9 00:00:22 2023 +0100 s390: vfio-ap: tighten the NIB validity check [ Upstream commit a64a6d23874c574d30a9816124b2dc37467f3811 ] The NIB is architecturally invalid if the address designates a storage location that is not installed or if it is zero. Signed-off-by: Halil Pasic <pasic@xxxxxxxxxxxxx> Reported-by: Janosch Frank <frankja@xxxxxxxxxxxxx> Fixes: ec89b55e3bce ("s390: ap: implement PAPQ AQIC interception in kernel") Reviewed-by: Tony Krowiak <akrowiak@xxxxxxxxxxxxx> Reviewed-by: Pierre Morel <pmorel@xxxxxxxxxxxxx> Signed-off-by: Heiko Carstens <hca@xxxxxxxxxxxxx> Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/drivers/s390/crypto/vfio_ap_ops.c b/drivers/s390/crypto/vfio_ap_ops.c index a109c59f18f78..934515959ebf4 100644 --- a/drivers/s390/crypto/vfio_ap_ops.c +++ b/drivers/s390/crypto/vfio_ap_ops.c @@ -349,6 +349,8 @@ static int vfio_ap_validate_nib(struct kvm_vcpu *vcpu, dma_addr_t *nib) { *nib = vcpu->run->s.regs.gprs[2]; + if (!*nib) + return -EINVAL; if (kvm_is_error_hva(gfn_to_hva(vcpu->kvm, *nib >> PAGE_SHIFT))) return -EINVAL;