瀏覽代碼

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

Isaku Yamahata 6 年之前
父節點
當前提交
2a978423fa
共有 1 個文件被更改,包括 2 次插入0 次删除
  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();
 }