linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Singh, Brijesh" <brijesh.singh@amd.com>
To: Nathaniel McCallum <npmccallum@redhat.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-crypto@vger.kernel.org" <linux-crypto@vger.kernel.org>
Cc: "Singh, Brijesh" <brijesh.singh@amd.com>
Subject: Re: SEV Command Privilege Separation
Date: Tue, 26 Feb 2019 19:18:53 +0000	[thread overview]
Message-ID: <4db2f309-237f-240d-e7f7-290391274237@amd.com> (raw)
In-Reply-To: <CAOASepP1+ZzGfy62jO5S4ZtpYzPJKqVZntTPp8Xn-zK8Kd2k8A@mail.gmail.com>



On 2/14/19 3:08 PM, Nathaniel McCallum wrote:
> I've been working on wrapping various SEV kernel APIs for userspace
> consumption. There does not appear to be any privilege separation for
> these commands: you can run them all or none of them. This is less
> than ideal because it means that a compromise of the code which
> launches VMs could make permanent changes to the SEV certificate
> chain.
> 
> These commands are required to attest the VM environment:
>    SEV_PDH_CERT_EXPORT
>    SEV_PLATFORM_STATUS
>    SEV_GET_ID
> 
> These commands manage the SEV certificate chain:
>    SEV_PEK_CERT_IMPORT
>    SEV_FACTORY_RESET
>    SEV_PEK_GEN
>    SEV_PEK_CSR
>    SEV_PDH_GEN
> 
> I would expect the first group of commands to be able to be called by
> whatever actor launches VMs. The latter group of commands should be
> able to be called by whatever actor manages the SEV environment.
> 
> I don't have strong opinions on how this privilege separation should
> happen. It might be sufficient to distinguish these based on the mode
> of the open() call. This could then be managed with filesystem
> permissions. But I'm open to other ideas.
> 


We had somewhat a similar discussion on libvirt ML, currently the
udev rules for the /dev/sev is 0600. As you have noticed there
is no privilege separation, if admin grants 0644 then user/group
will able to issue a command which can modify  the SEV certificate
chain. At the very minimal we should perform the mode check
before issuing the commands to PSP. If user does not have 'write'
access then any commands which modifies the cert-chain should
fail. Its in my TODO list, the patches are always welcome :)

-Brijesh

      reply	other threads:[~2019-02-26 19:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-14 21:08 SEV Command Privilege Separation Nathaniel McCallum
2019-02-26 19:18 ` Singh, Brijesh [this message]

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=4db2f309-237f-240d-e7f7-290391274237@amd.com \
    --to=brijesh.singh@amd.com \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=npmccallum@redhat.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;
as well as URLs for NNTP newsgroup(s).