lkml.org 
[lkml]   [2020]   [Jul]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v34 12/24] x86/sgx: Add SGX_IOC_ENCLAVE_CREATE
On Mon, Jul 06, 2020 at 08:29:15PM -0700, Sean Christopherson wrote:
> On Tue, Jul 07, 2020 at 06:01:52AM +0300, Jarkko Sakkinen wrote:
> > +long sgx_ioctl(struct file *filep, unsigned int cmd, unsigned long arg)
> > +{
> > + struct sgx_encl *encl = filep->private_data;
> > + int ret, encl_flags;
> > +
> > + encl_flags = atomic_fetch_or(SGX_ENCL_IOCTL, &encl->flags);
> > + if (encl_flags & SGX_ENCL_IOCTL)
> > + return -EBUSY;
>
> As called out in my belated feedback, SGX_ENCL_DEAD needs to be checked
> here to prevent invoking ENCLS operations on a dead enclave. If you're
> splitting hairs, the check could technically be deferred until the next
> patch, "Add SGX_IOC_ENCLAVE_ADD_PAGES", which is the first usage of
> sgx_encl_destroy() from an ioctl(), but that seems a bit gratuitous.

This is already fixed in v35.

/Jarkko

\
 
 \ /
  Last update: 2020-07-07 06:05    [W:0.059 / U:2.688 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site