Explorar el Código

[Pal/Linux-SGX] Zero out LibOS TCB area on thread startup

Isaku Yamahata hace 6 años
padre
commit
2a978423fa
Se han modificado 1 ficheros con 2 adiciones y 0 borrados
  1. 2 0
      Pal/src/host/Linux-SGX/db_threading.c

+ 2 - 0
Pal/src/host/Linux-SGX/db_threading.c

@@ -88,6 +88,8 @@ void pal_start_thread (void)
     new_thread->param = NULL;
     SET_ENCLAVE_TLS(thread, new_thread);
     SET_ENCLAVE_TLS(ready_for_exceptions, 1UL);
+    PAL_TCB* pal_tcb = pal_get_tcb();
+    memset(&pal_tcb->libos_tcb, 0, sizeof(pal_tcb->libos_tcb));
     callback((void *) param);
     _DkThreadExit();
 }