Skip to content

Commit 0dcf1cf

Browse files
author
Jethro Beekman
committed
Remove mprotect in sgx_enclave_common loader
This was added to workaround intel/confidential-computing.sgx#348 but apparently newer driver/sgx_enclave_common version combinations don't suffer this problem.
1 parent 2fb7b67 commit 0dcf1cf

File tree

1 file changed

+0
-13
lines changed
  • intel-sgx/sgxs-loaders/src/sgx_enclave_common

1 file changed

+0
-13
lines changed

intel-sgx/sgxs-loaders/src/sgx_enclave_common/mod.rs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ use std::io::{Result as IoResult, Error as IoError};
1111
use std::os::raw::c_void;
1212
use std::sync::Arc;
1313
use std::{fmt, mem, ptr};
14-
#[cfg(unix)]
15-
use libc;
1614

1715
use sgx_isa::{Attributes, Einittoken, Miscselect, PageType, SecinfoFlags, Secs, Sigstruct};
1816
use sgxs::einittoken::EinittokenProvider;
@@ -254,17 +252,6 @@ impl EnclaveLoad for InnerLibrary {
254252
return Err(Error::Init(error.into()));
255253
}
256254

257-
#[cfg(unix)]
258-
{
259-
if libc::mprotect(
260-
mapping.base as _,
261-
mapping.size as _,
262-
libc::PROT_READ | libc::PROT_WRITE | libc::PROT_EXEC,
263-
) == -1 {
264-
return Err(Error::Init(LibraryError::PageTableFailure(IoError::last_os_error())));
265-
}
266-
}
267-
268255
Ok(())
269256
}
270257
}

0 commit comments

Comments
 (0)