Skip to content

Commit 5e89779

Browse files
eaugergregkh
authored andcommitted
KVM: arm64: Fix KVM_VGIC_V3_ADDR_TYPE_REDIST_REGION read
commit 53b16dd upstream. The doc says: "The characteristics of a specific redistributor region can be read by presetting the index field in the attr data. Only valid for KVM_DEV_TYPE_ARM_VGIC_V3" Unfortunately the existing code fails to read the input attr data. Fixes: 04c1109 ("KVM: arm/arm64: Implement KVM_VGIC_V3_ADDR_TYPE_REDIST_REGION") Cc: stable@vger.kernel.org#v4.17+ Signed-off-by: Eric Auger <eric.auger@redhat.com> Reviewed-by: Alexandru Elisei <alexandru.elisei@arm.com> Signed-off-by: Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/20210405163941.510258-3-eric.auger@redhat.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 918e08d commit 5e89779

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎arch/arm64/kvm/vgic/vgic-kvm-device.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,9 @@ static int vgic_get_common_attr(struct kvm_device *dev,
226226
u64 addr;
227227
unsigned long type = (unsigned long)attr->attr;
228228

229+
if (copy_from_user(&addr, uaddr, sizeof(addr)))
230+
return -EFAULT;
231+
229232
r = kvm_vgic_addr(dev->kvm, type, &addr, false);
230233
if (r)
231234
return (r == -ENODEV) ? -ENXIO : r;

0 commit comments

Comments
 (0)