linux-sgx.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sean Christopherson <sean.j.christopherson@intel.com>
To: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Cc: linux-sgx@vger.kernel.org
Subject: [PATCH] x86/sgx: Update correct attributes variable when allowing provisioning
Date: Thu,  1 Oct 2020 14:02:08 -0700	[thread overview]
Message-ID: <20201001210208.19070-1-sean.j.christopherson@intel.com> (raw)

Set the PROVISIONKEY flag in attributes_mask, a.k.a. the mask of allowed
attributes for the enclave, when the enclave's owner demonstrates access
to /dev/sgx/provision.  Setting the flag in the enclave's attributes
effectively declares intent to access the key, whereas the ioctl()'s
intent is to grant access to the key.

Fixes: 80e062767a37 ("x86/sgx: Add SGX_IOC_ENCLAVE_PROVISION")
Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
---
 arch/x86/kernel/cpu/sgx/ioctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/cpu/sgx/ioctl.c b/arch/x86/kernel/cpu/sgx/ioctl.c
index ec38a9416788..16d0c9abafc2 100644
--- a/arch/x86/kernel/cpu/sgx/ioctl.c
+++ b/arch/x86/kernel/cpu/sgx/ioctl.c
@@ -763,7 +763,7 @@ static long sgx_ioc_enclave_provision(struct sgx_encl *encl, void __user *arg)
 		goto out;
 	}
 
-	encl->attributes |= SGX_ATTR_PROVISIONKEY;
+	encl->attributes_mask |= SGX_ATTR_PROVISIONKEY;
 	ret = 0;
 
 out:
-- 
2.28.0


             reply	other threads:[~2020-10-01 21:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-01 21:02 Sean Christopherson [this message]
2020-10-01 22:10 ` [PATCH] x86/sgx: Update correct attributes variable when allowing provisioning Jarkko Sakkinen

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=20201001210208.19070-1-sean.j.christopherson@intel.com \
    --to=sean.j.christopherson@intel.com \
    --cc=jarkko.sakkinen@linux.intel.com \
    --cc=linux-sgx@vger.kernel.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).