]> git.itanic.dy.fi Git - linux-stable/commit
arm/arm64: KVM: Fix ioctl error handling
authorMichael S. Tsirkin <mst@redhat.com>
Sun, 28 Feb 2016 15:32:07 +0000 (17:32 +0200)
committerSasha Levin <sasha.levin@oracle.com>
Fri, 11 Mar 2016 14:45:24 +0000 (09:45 -0500)
commita0afb034eef8385fdfa882b103f5e3ec9f43b0ae
treec6df9e6b42f39108593e592043fa9721fb16c594
parent6303c5122e28d378ccd755310307b938ad76e9ae
arm/arm64: KVM: Fix ioctl error handling

[ Upstream commit 4cad67fca3fc952d6f2ed9e799621f07666a560f ]

Calling return copy_to_user(...) in an ioctl will not
do the right thing if there's a pagefault:
copy_to_user returns the number of bytes not copied
in this case.

Fix up kvm to do
return copy_to_user(...)) ?  -EFAULT : 0;

everywhere.

Cc: stable@vger.kernel.org
Acked-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
arch/arm/kvm/guest.c
arch/arm64/kvm/guest.c