linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] KVM: Fix !KVM_COMPAT ioctl behaviour
@ 2018-06-19  9:42 Marc Zyngier
  2018-06-19  9:42 ` [PATCH 1/2] KVM: Enforce error in ioctl for compat tasks when !KVM_COMPAT Marc Zyngier
  2018-06-19  9:42 ` [PATCH 2/2] KVM: arm64: Prevent KVM_COMPAT from being selected Marc Zyngier
  0 siblings, 2 replies; 9+ messages in thread
From: Marc Zyngier @ 2018-06-19  9:42 UTC (permalink / raw)
  To: linux-arm-kernel

Mark Rutland recently pointed out that a couple of issues with the way
we deal with compat tasks:

1) arm64 unexpectedly selects KVM_COMPAT, while offering no way for a
   32bit userspace to change any register

2) Even deselecting KVM_COMPAT, we end-up with compat_ioctl being NULL,
   and the VFS behaviour is thus to call the non-compat ioctl

(1) is completely unintentional and should be fixed. (2) is quite odd,
and probably just as unintentional. This series fixes it by installing
a compat_ioctl callback whose only job is to return -EINVAL.

Tested on arm64 with a 32bit kvmtool.

Marc Zyngier (2):
  KVM: Enforce error in ioctl for compat tasks when !KVM_COMPAT
  KVM: arm64: Prevent KVM_COMPAT from being selected

 virt/kvm/Kconfig    |  2 +-
 virt/kvm/kvm_main.c | 19 +++++++++----------
 2 files changed, 10 insertions(+), 11 deletions(-)

-- 
2.17.1

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2018-06-21 15:03 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-19  9:42 [PATCH 0/2] KVM: Fix !KVM_COMPAT ioctl behaviour Marc Zyngier
2018-06-19  9:42 ` [PATCH 1/2] KVM: Enforce error in ioctl for compat tasks when !KVM_COMPAT Marc Zyngier
2018-06-19 10:01   ` Mark Rutland
2018-06-19 10:10     ` Marc Zyngier
2018-06-19 11:24       ` Christian Borntraeger
2018-06-21 11:40         ` Marc Zyngier
2018-06-21 15:03           ` Radim Krčmář
2018-06-19  9:42 ` [PATCH 2/2] KVM: arm64: Prevent KVM_COMPAT from being selected Marc Zyngier
2018-06-19 10:10   ` Mark Rutland

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).