qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Martin Kletzander <mkletzan@redhat.com>
To: "Daniel P. Berrangé" <berrange@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 12:31:38 +0100	[thread overview]
Message-ID: <20190118113138.GA8296@wheatley> (raw)
In-Reply-To: <20190118111711.GJ20660@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 2239 bytes --]

On Fri, Jan 18, 2019 at 11:17:11AM +0000, Daniel P. Berrangé wrote:
>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).
>

So you are trying to protect from buggy qemu with malicious guest, not really a
malicious qemu.  I got confused as SEV is trying to protect against
untrustworthy host including binaries like qemu.  OK

>
>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 :|

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2019-01-18 11:31 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é
2019-01-18 11:31       ` Martin Kletzander [this message]
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=20190118113138.GA8296@wheatley \
    --to=mkletzan@redhat.com \
    --cc=berrange@redhat.com \
    --cc=brijesh.singh@amd.com \
    --cc=dinechin@redhat.com \
    --cc=eskultet@redhat.com \
    --cc=libvir-list@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).