]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: Forbid /dev/kvm being opened by a compat task when CONFIG_KVM_COMPAT=n
authorMarc Zyngier <maz@kernel.org>
Wed, 13 Nov 2019 16:05:23 +0000 (16:05 +0000)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 13 Nov 2019 16:13:12 +0000 (17:13 +0100)
commita50ef1566d118f360a3f42e8f9d905e42613e586
treece6d3de7b302079d4b624276a18007a9118ba838
parentc71caaa9740bbb88166fc5c1cf6087230e9b8478
KVM: Forbid /dev/kvm being opened by a compat task when CONFIG_KVM_COMPAT=n

On a system without KVM_COMPAT, we prevent IOCTLs from being issued
by a compat task. Although this prevents most silly things from
happening, it can still confuse a 32bit userspace that is able
to open the kvm device (the qemu test suite seems to be pretty
mad with this behaviour).

Take a more radical approach and return a -ENODEV to the compat
task.

Reported-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
virt/kvm/kvm_main.c