Skip to content

Commit

Permalink
Effectively zero TLS section on thread cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: Amaury Chamayou <[email protected]>
  • Loading branch information
achamayou committed Nov 23, 2021
1 parent 264c967 commit 236e3a0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion enclave/core/sgx/threadlocal.c
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,11 @@ oe_result_t oe_thread_local_cleanup(oe_sgx_td_t* td)
// (i.e., tls_start is NULL when tdata and tbss are zero).
oe_allocator_thread_cleanup();
if (tls_start)
oe_memset_s(tls_start, (uint64_t)(fs - tls_start), 0, 0);
oe_memset_s(
tls_start,
(uint64_t)(fs - tls_start),
0,
(uint64_t)(fs - tls_start));

return OE_OK;
}

0 comments on commit 236e3a0

Please sign in to comment.