Browse Source

[Pal/Linux-SGX] Propagate untrusted environment variables to untrusted child process

Propagating untrusted environment variables to the child process does not harm
security of enclaves. This propagation is required for e.g. debugging multi-
process applications and for network proxy settings.

Note that trusted environment variables are correctly passed from parent enclave
to child enclave using the checkpoint/restore protocol.
Dmitrii Kuvaiskii 6 years ago
parent
commit
153b9b364f
1 changed files with 2 additions and 1 deletions
  1. 2 1
      Pal/src/host/Linux-SGX/sgx_process.c

+ 2 - 1
Pal/src/host/Linux-SGX/sgx_process.c

@@ -91,7 +91,8 @@ int sgx_create_process (const char * uri, int nargs, const char ** args,
         if (IS_ERR(rete))
             goto out_child;
 
-        rete = INLINE_SYSCALL(execve, 3, PAL_LOADER, argv, NULL);
+        extern char** environ;
+        rete = INLINE_SYSCALL(execve, 3, PAL_LOADER, argv, environ);
 
         /* shouldn't get to here */
         SGX_DBG(DBG_E, "unexpected failure of new process\n");