From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Martin Kletzander <mkletzan@redhat.com>
Cc: Erik Skultety <eskultet@redhat.com>,
libvir-list@redhat.com, qemu-devel@nongnu.org,
brijesh.singh@amd.com, dinechin@redhat.com
Subject: Re: [Qemu-devel] AMD SEV's /dev/sev permissions and probing QEMU for capabilities
Date: Fri, 18 Jan 2019 11:17:11 +0000 [thread overview]
Message-ID: <20190118111711.GJ20660@redhat.com> (raw)
In-Reply-To: <20190118111150.GA28476@wheatley>
On Fri, Jan 18, 2019 at 12:11:50PM +0100, Martin Kletzander wrote:
> On Fri, Jan 18, 2019 at 10:16:38AM +0000, Daniel P. Berrangé wrote:
> > I've just realized there is a potential 3rd solution. Remember there is
> > actually nothing inherantly special about the 'root' user as an account
> > ID. 'root' gains its powers from the fact that it has many capabilities
> > by default. 'qemu' can't access /dev/sev because it is owned by a
> > different user (happens to be root) and 'qemu' does not have capabilities.
> >
> > So we can make probing work by using our capabilities code to grant
> > CAP_DAC_OVERRIDE to the qemu process we spawn. So probing still runs
> > as 'qemu', but can none the less access /dev/sev while it is owned
> > by root. We were not using 'qemu' for sake of security, as the probing
> > process is not executing any untrusthworthy code, so we don't loose any
> > security protection by granting CAP_DAC_OVERRIDE.
> >
>
> IMHO CAP_DAC_OVERRIDE is a lot, especially on systems without SELinux.
Probing of QEMU capabilities is not a security critical task. QEMU is
run with "-machine none" so does not even create the virtual machine
hardware, nor have any guest image that it would run. All it is running
is the QEMU class initialization code. The only way for that to act in
a malicious way is for a backdoor to have been inserted when QEMU was
built by the OS vendor, or fo the QEMU binary on disk to have been
replaced by something malcious (which would require root privileges
itself).
We must of coure *NEVER* give CAP_DAC_OVERRIDE to a QEMU that is running
the real, untrustworty, end user VM.
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
next prev parent reply other threads:[~2019-01-18 11:17 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-18 9:39 [Qemu-devel] AMD SEV's /dev/sev permissions and probing QEMU for capabilities Erik Skultety
2019-01-18 10:16 ` Daniel P. Berrangé
2019-01-18 10:56 ` [Qemu-devel] [libvirt] " Erik Skultety
2019-01-18 11:11 ` [Qemu-devel] " Martin Kletzander
2019-01-18 11:17 ` Daniel P. Berrangé [this message]
2019-01-18 11:31 ` Martin Kletzander
2019-01-18 12:51 ` Singh, Brijesh
2019-01-23 12:55 ` Erik Skultety
2019-01-23 13:10 ` Daniel P. Berrangé
2019-01-23 13:22 ` Erik Skultety
2019-01-23 13:24 ` Daniel P. Berrangé
2019-01-23 13:33 ` Erik Skultety
2019-01-23 13:36 ` Daniel P. Berrangé
2019-01-23 15:02 ` Singh, Brijesh
2019-01-23 15:29 ` Erik Skultety
2019-01-29 16:15 ` Erik Skultety
2019-01-29 18:40 ` Daniel P. Berrangé
2019-01-30 8:06 ` Erik Skultety
2019-01-30 10:37 ` Daniel P. Berrangé
2019-01-30 13:39 ` Erik Skultety
2019-01-30 17:47 ` Singh, Brijesh
2019-01-30 18:18 ` Daniel P. Berrangé
2019-01-31 15:28 ` Erik Skultety
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=20190118111711.GJ20660@redhat.com \
--to=berrange@redhat.com \
--cc=brijesh.singh@amd.com \
--cc=dinechin@redhat.com \
--cc=eskultet@redhat.com \
--cc=libvir-list@redhat.com \
--cc=mkletzan@redhat.com \
--cc=qemu-devel@nongnu.org \
/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;
as well as URLs for NNTP newsgroup(s).