All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bandan Das <bsd@redhat.com>
To: Brijesh Singh <brijesh.singh@amd.com>
Cc: Connor Kuehl <ckuehl@redhat.com>,
	thomas.lendacky@amd.com, herbert@gondor.apana.org.au,
	davem@davemloft.net, gary.hook@amd.com, erdemaktas@google.com,
	rientjes@google.com, npmccallum@redhat.com,
	linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] crypto: ccp: use file mode for sev ioctl permissions
Date: Tue, 10 Mar 2020 10:45:24 -0400	[thread overview]
Message-ID: <jpgpndkjmkb.fsf@linux.bootlegged.copy> (raw)
In-Reply-To: <b037d70f-c23f-72d6-3866-57cb1e501eba@amd.com> (Brijesh Singh's message of "Tue, 10 Mar 2020 09:37:21 -0500")

Brijesh Singh <brijesh.singh@amd.com> writes:

> On 3/6/20 11:20 AM, Connor Kuehl wrote:
>> Instead of using CAP_SYS_ADMIN which is restricted to the root user,
>> check the file mode for write permissions before executing commands that
>> can affect the platform. This allows for more fine-grained access
>> control to the SEV ioctl interface. This would allow a SEV-only user
>> or group the ability to administer the platform without requiring them
>> to be root or granting them overly powerful permissions.
>>
>> For example:
>>
>> chown root:root /dev/sev
>> chmod 600 /dev/sev
>> setfacl -m g:sev:r /dev/sev
>> setfacl -m g:sev-admin:rw /dev/sev
>>
>> In this instance, members of the "sev-admin" group have the ability to
>> perform all ioctl calls (including the ones that modify platform state).
>> Members of the "sev" group only have access to the ioctls that do not
>> modify the platform state.
>>
>> This also makes opening "/dev/sev" more consistent with how file
>> descriptors are usually handled. By only checking for CAP_SYS_ADMIN,
>> the file descriptor could be opened read-only but could still execute
>> ioctls that modify the platform state. This patch enforces that the file
>> descriptor is opened with write privileges if it is going to be used to
>> modify the platform state.
>>
>> This flexibility is completely opt-in, and if it is not desirable by
>> the administrator then they do not need to give anyone else access to
>> /dev/sev.
>>
>> Signed-off-by: Connor Kuehl <ckuehl@redhat.com>
>> ---
>>   drivers/crypto/ccp/sev-dev.c | 33 +++++++++++++++++----------------
>>   1 file changed, 17 insertions(+), 16 deletions(-)
>>
>
> Reviewed-by: Brijesh Singh <brijesh.singh@amd.com>
>
> thanks

Reviewed-by: Bandan Das <bsd@redhat.com>


  reply	other threads:[~2020-03-10 14:45 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-06 17:20 [PATCH 0/1] crypto: ccp: use file mode for sev ioctl permissions Connor Kuehl
2020-03-06 17:20 ` [PATCH 1/1] " Connor Kuehl
2020-03-08 21:54   ` David Rientjes
2020-03-09 14:03     ` Nathaniel McCallum
2020-03-10  0:43       ` David Rientjes
2020-03-10 14:37   ` Brijesh Singh
2020-03-10 14:45     ` Bandan Das [this message]
2020-03-10 19:02       ` David Rientjes
2020-03-10 19:53   ` Tom Lendacky
2020-03-12 12:40   ` Herbert Xu
2020-03-06 20:48 ` [PATCH 0/1] " Nathaniel McCallum

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=jpgpndkjmkb.fsf@linux.bootlegged.copy \
    --to=bsd@redhat.com \
    --cc=brijesh.singh@amd.com \
    --cc=ckuehl@redhat.com \
    --cc=davem@davemloft.net \
    --cc=erdemaktas@google.com \
    --cc=gary.hook@amd.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=npmccallum@redhat.com \
    --cc=rientjes@google.com \
    --cc=thomas.lendacky@amd.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.