]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
KVM: Reject device ioctls from processes other than the VM's creator
authorSean Christopherson <sean.j.christopherson@intel.com>
Fri, 15 Feb 2019 20:48:39 +0000 (12:48 -0800)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Aug 2019 09:18:49 +0000 (11:18 +0200)
commit9ac1b9430abb1cb9f57bbe3e0c2ed5319d73b2d0
tree52ecce6a716002d965a785fa112c0098a0ebc2c0
parent026b5b5bb4a85f5d99a3db47cd21ead10d6a6b00
KVM: Reject device ioctls from processes other than the VM's creator

BugLink: https://bugs.launchpad.net/bugs/1838116
commit ddba91801aeb5c160b660caed1800eb3aef403f8 upstream.

KVM's API requires thats ioctls must be issued from the same process
that created the VM.  In other words, userspace can play games with a
VM's file descriptors, e.g. fork(), SCM_RIGHTS, etc..., but only the
creator can do anything useful.  Explicitly reject device ioctls that
are issued by a process other than the VM's creator, and update KVM's
API documentation to extend its requirements to device ioctls.

Fixes: 852b6d57dc7f ("kvm: add device control API")
Cc: <stable@vger.kernel.org>
Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
Documentation/virtual/kvm/api.txt
virt/kvm/kvm_main.c