]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: Enforce error in ioctl for compat tasks when !KVM_COMPAT
authorMarc Zyngier <marc.zyngier@arm.com>
Sun, 17 Jun 2018 09:16:21 +0000 (10:16 +0100)
committerMarc Zyngier <marc.zyngier@arm.com>
Thu, 21 Jun 2018 16:17:50 +0000 (17:17 +0100)
commit3db2d0f873392e229d35f08be964da58c10b244d
tree881292b233bf620c55ae432583778e59a18f4591
parent039b668fc43e40ad7bd3c6ce6eb31d2e3cb4c62f
KVM: Enforce error in ioctl for compat tasks when !KVM_COMPAT

The current behaviour of the compat ioctls is a bit odd.
We provide a compat_ioctl method when KVM_COMPAT is set, and NULL
otherwise. But NULL means that the normal, non-compat ioctl should
be used directly for compat tasks, and there is no way to actually
prevent a compat task from issueing KVM ioctls.

This patch changes this behaviour, by always registering a compat_ioctl
method, even if KVM_COMPAT is not selected. In that case, the callback
will always return -EINVAL.

Fixes: 64601bd4cd9857b4a249 ("KVM: Disable compat ioctl for s390")
Reported-by: Mark Rutland <mark.rutland@arm.com>
Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
Acked-by: Radim Krčmář <rkrcmar@redhat.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
virt/kvm/kvm_main.c