mbox series

[0/4] Migrate enclave mapping to an anonymous inode

Message ID 20200331114432.7593-1-jarkko.sakkinen@linux.intel.com (mailing list archive)
Headers show
Series Migrate enclave mapping to an anonymous inode | expand

Message

Jarkko Sakkinen March 31, 2020, 11:44 a.m. UTC
Given that distributions are converting /dev to noexec, there is no really
other option than to use an anonymous inode for the enclave run-time
representation.

This results the following constraints:

1. Enclave can be fully built and initialized by a process with hno
   special privileges.
2. To run an initialized enclave, exec-from-mem is required.

This patche set segregates these responsibilities by keeping the build
interface in the device fd and moving the mapping interface to the
newly introduced enclave fd.

Cc: luto@kernel.org
Cc: Stephen Smalley <sds@tycho.nsa.gov>
Cc: Casey Schaufler <casey@schaufler-ca.com>
Cc: Haitao Huang <haitao.huang@linux.intel.com>
Cc: Sean Christopherson <sean.j.christopherson@intel.com>


Jarkko Sakkinen (4):
  x86/sgx: Remove PROT_NONE branch from sgx_encl_may_map().
  x86/sgx: Put enclaves into anonymous files
  x86/sgx: Move mmap() to the anonymous enclave file
  x86/sgx: Hand over the enclave file to the user space

 Documentation/x86/sgx.rst          |  13 ++--
 arch/x86/include/uapi/asm/sgx.h    |   2 +
 arch/x86/kernel/cpu/sgx/driver.c   | 119 +++++++++++++++++++----------
 arch/x86/kernel/cpu/sgx/encl.c     |   7 +-
 arch/x86/kernel/cpu/sgx/ioctl.c    |  64 +++++++++-------
 tools/testing/selftests/sgx/load.c |  19 +++--
 tools/testing/selftests/sgx/main.c |   3 +-
 tools/testing/selftests/sgx/main.h |   3 +-
 8 files changed, 136 insertions(+), 94 deletions(-)