-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Description
- Feature Name: untrusted device memory
- Start Date: 2022-08-22
Summary
Occlum gets the untrusted memory range and registers the untrusted memory range into the SGX untrusted allocator.
Motivation
When supporting the untrusted device, we could get some untrusted memory that is shared with the device. The SGX untrusted allocator could help to manage this area. The application may do mprotect or munmap with the virtual address inside the untrusted area.
Guide-level explanation
The existing sgx-untrusted-alloc crate (https://github.com/occlum/ngo/tree/master/src/libos/crates/sgx-untrusted-alloc) could be extended to support the new feature.
The new interfaces are required:
- insert a committed untrusted memory range into the allocator
- remove a range of memory from the allocator (If the range is added by the insert interface)
Below is one example:
When an application performs munmap with an untrusted memory address
- First, check whether the address is inside the enclave or an outside address.
- If the address is an outside address, query the Untrusted Allocator to confirm it is a legal address managed by the allocator
- Perform the munmap with the address
- If the area is mapped with an untrusted device, remove the range from the allocator
Metadata
Metadata
Assignees
Labels
No labels