public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: "Christian Borntraeger" <borntraeger@de.ibm.com>,
	kvm-devel <kvm@vger.kernel.org>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Radim Krčmář" <rkrcmar@redhat.com>,
	"James Morse" <james.morse@arm.com>,
	"Julien Thierry" <julien.thierry.kdev@gmail.com>,
	"Suzuki K Poulose" <suzuki.poulose@arm.com>,
	"James Hogan" <jhogan@kernel.org>,
	"Paul Mackerras" <paulus@ozlabs.org>,
	"Janosch Frank" <frankja@linux.ibm.com>,
	"David Hildenbrand" <david@redhat.com>,
	"Cornelia Huck" <cohuck@redhat.com>,
	"Sean Christopherson" <sean.j.christopherson@intel.com>,
	"Vitaly Kuznetsov" <vkuznets@redhat.com>,
	"Wanpeng Li" <wanpengli@tencent.com>,
	"Jim Mattson" <jmattson@google.com>,
	"Joerg Roedel" <joro@8bytes.org>
Subject: Re: [PATCH] KVM: Forbid /dev/kvm being opened by a compat task when CONFIG_KVM_COMPAT=n
Date: Thu, 14 Nov 2019 08:15:50 +0000	[thread overview]
Message-ID: <20191114081550.3c6a7a47@why> (raw)
In-Reply-To: <CAFEAcA8c3ePLXRa_-G0jPgMVVrFHaN1Qn3qRf-WShPXmNXX6Ug@mail.gmail.com>

On Wed, 13 Nov 2019 21:23:07 +0000
Peter Maydell <peter.maydell@linaro.org> wrote:

> On Wed, 13 Nov 2019 at 18:44, Christian Borntraeger
> <borntraeger@de.ibm.com> wrote:
> > On 13.11.19 17:05, Marc Zyngier wrote:  
> > > 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.  
> 
> > Do we still need compat_ioctl if open never succeeds?  
> 
> I wondered about that, but presumably you could use
> fd-passing, or just inheriting open fds across exec(),
> to open the fd in a 64-bit process and then hand it off
> to a 32-bit process to call the ioctl with. (That's
> probably only something you'd do if you were
> deliberately playing silly games, of course, but
> preventing silly games is useful as it makes it
> easier to reason about kernel behaviour.)

This was exactly my train of thoughts, which I should have made clear
in the commit log. Thanks Peter for reading my mind! ;-)

	M.
-- 
Jazz is not dead. It just smells funny...

  reply	other threads:[~2019-11-14  8:15 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-13 16:05 [PATCH] KVM: Forbid /dev/kvm being opened by a compat task when CONFIG_KVM_COMPAT=n Marc Zyngier
2019-11-13 16:12 ` Paolo Bonzini
2019-11-13 18:43 ` Christian Borntraeger
2019-11-13 21:23   ` Peter Maydell
2019-11-14  8:15     ` Marc Zyngier [this message]
2019-11-14  8:20       ` Christian Borntraeger
2019-11-14 12:12         ` Paolo Bonzini
2019-11-14 13:22           ` Marc Zyngier
2019-11-14 13:28             ` Peter Maydell
2019-11-15  9:53               ` Paolo Bonzini
2019-11-15  9:14             ` Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191114081550.3c6a7a47@why \
    --to=maz@kernel.org \
    --cc=borntraeger@de.ibm.com \
    --cc=cohuck@redhat.com \
    --cc=david@redhat.com \
    --cc=frankja@linux.ibm.com \
    --cc=james.morse@arm.com \
    --cc=jhogan@kernel.org \
    --cc=jmattson@google.com \
    --cc=joro@8bytes.org \
    --cc=julien.thierry.kdev@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=paulus@ozlabs.org \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=rkrcmar@redhat.com \
    --cc=sean.j.christopherson@intel.com \
    --cc=suzuki.poulose@arm.com \
    --cc=vkuznets@redhat.com \
    --cc=wanpengli@tencent.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox