[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190612142557.GB20308@linux.intel.com>
Date: Wed, 12 Jun 2019 07:25:57 -0700
From: Sean Christopherson <sean.j.christopherson@...el.com>
To: "Dr. Greg" <greg@...ellic.com>
Cc: Stephen Smalley <sds@...ho.nsa.gov>,
Cedric Xing <cedric.xing@...el.com>,
linux-security-module@...r.kernel.org, selinux@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-sgx@...r.kernel.org,
jarkko.sakkinen@...ux.intel.com, luto@...nel.org,
jmorris@...ei.org, serge@...lyn.com, paul@...l-moore.com,
eparis@...isplace.org, jethro@...tanix.com, dave.hansen@...el.com,
tglx@...utronix.de, torvalds@...ux-foundation.org,
akpm@...ux-foundation.org, nhorman@...hat.com,
pmccallum@...hat.com, serge.ayoun@...el.com,
shay.katz-zamir@...el.com, haitao.huang@...el.com,
andriy.shevchenko@...ux.intel.com, kai.svahn@...el.com,
bp@...en8.de, josh@...htriplett.org, kai.huang@...el.com,
rientjes@...gle.com, william.c.roberts@...el.com,
philip.b.tricca@...el.com
Subject: Re: [RFC PATCH v1 2/3] LSM/x86/sgx: Implement SGX specific hooks in
SELinux
On Wed, Jun 12, 2019 at 04:32:21AM -0500, Dr. Greg wrote:
> With SGX2 we will, by necessity, have to admit the notion that a
> platform owner will not have any effective visibility into code that
> is loaded and executed, since it can come in over a secured network
> connection in an enclave security context. This advocates for the
> simplest approach possible to providing some type of regulation to any
> form of WX page access.
I believe we're all on the same page in the sense that we all want the
"simplest approach possible", but there's a sliding scale of complexity
between the kernel and userspace. We can make life simple for userspace
at the cost of additional complexity in the kernel, and vice versa. The
disagreement is over where to shove the extra complexity.
> Current state of the art, and there doesn't appear to be a reason to
> change this, is to package an enclave in the form of an ELF shared
> library. It seems straight forward to inherit and act on page
> privileges from the privileges specified on the ELF sections that are
> loaded. Loaders will have a file descriptor available so an mmap of
> the incoming page with the specified privileges should trigger the
> required LSM interventions and tie them to a specific enclave.
>
> The current enclave 'standard' also uses layout metadata, stored in a
> special .notes section of the shared image, to direct a loader with
> respect to construction of the enclave stack, heap, TCS and other
> miscellaneous regions not directly coded by the ELF TEXT sections. It
> seems straight forward to extend this paradigm to declare region(s) of
> an enclave that are eligible to be generated at runtime (EAUG'ed) with
> the RWX protections needed to support dynamically loaded code.
>
> If an enclave wishes to support this functionality, it would seem
> straight forward to require an enclave to provide a single zero page
> which the loader will mmap with those protections in order to trigger
> the desired LSM checks against that specific enclave.
This is effectively #1, e.g. would require userspace to pre-declare its
intent to make regions W->X.
Powered by blists - more mailing lists