Skip to content

Migrate enclave mapping to an anonymous inode

Jarkko Sakkinen linux-sgx 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 41 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4x86/sgx: Remove PROT_NONE branch from sgx_encl_may_map().Documentation/x86/sgx.rst arch/x86/kernel/cpu/sgx/encl.c arch/x86/kernel/cpu/sgx/ioctl.c +1 more+8 -200 replies
2/4x86/sgx: Put enclaves into anonymous filesarch/x86/kernel/cpu/sgx/driver.c arch/x86/kernel/cpu/sgx/ioctl.c+71 -3441 replies
3/4x86/sgx: Move mmap() to the anonymous enclave filearch/x86/kernel/cpu/sgx/driver.c+22 -230 replies
4/4x86/sgx: Hand over the enclave file to the user spacearch/x86/include/uapi/asm/sgx.h arch/x86/kernel/cpu/sgx/ioctl.c tools/testing/selftests/sgx/load.c +2 more+49 -310 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

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

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 Stephen Smalley <[email protected]>
Cc Casey Schaufler <[email protected]>
Cc Haitao Huang <[email protected]>
Cc Sean Christopherson <[email protected]>

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(-)
Signature · 1 line
2.25.1