|
@@ -215,16 +215,18 @@ void pal_linux_main(char * uptr_args, uint64_t args_size,
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ pal_sec.heap_min = GET_ENCLAVE_TLS(heap_min);
|
|
|
|
|
+ pal_sec.heap_max = GET_ENCLAVE_TLS(heap_max);
|
|
|
pal_sec.exec_addr = GET_ENCLAVE_TLS(exec_addr);
|
|
pal_sec.exec_addr = GET_ENCLAVE_TLS(exec_addr);
|
|
|
pal_sec.exec_size = GET_ENCLAVE_TLS(exec_size);
|
|
pal_sec.exec_size = GET_ENCLAVE_TLS(exec_size);
|
|
|
|
|
|
|
|
/* Zero the heap. We need to take care to not zero the exec area. */
|
|
/* Zero the heap. We need to take care to not zero the exec area. */
|
|
|
|
|
|
|
|
- void* zero1_start = sec_info.heap_min;
|
|
|
|
|
- void* zero1_end = sec_info.heap_max;
|
|
|
|
|
|
|
+ void* zero1_start = pal_sec.heap_min;
|
|
|
|
|
+ void* zero1_end = pal_sec.heap_max;
|
|
|
|
|
|
|
|
- void* zero2_start = sec_info.heap_max;
|
|
|
|
|
- void* zero2_end = sec_info.heap_max;
|
|
|
|
|
|
|
+ void* zero2_start = pal_sec.heap_max;
|
|
|
|
|
+ void* zero2_end = pal_sec.heap_max;
|
|
|
|
|
|
|
|
if (pal_sec.exec_addr != NULL) {
|
|
if (pal_sec.exec_addr != NULL) {
|
|
|
zero1_end = MIN(zero1_end, pal_sec.exec_addr);
|
|
zero1_end = MIN(zero1_end, pal_sec.exec_addr);
|
|
@@ -290,10 +292,6 @@ void pal_linux_main(char * uptr_args, uint64_t args_size,
|
|
|
pal_sec.gid = sec_info.gid;
|
|
pal_sec.gid = sec_info.gid;
|
|
|
|
|
|
|
|
|
|
|
|
|
- /* TODO: remove with PR #589 */
|
|
|
|
|
- pal_sec.heap_min = sec_info.heap_min;
|
|
|
|
|
- pal_sec.heap_max = sec_info.heap_max;
|
|
|
|
|
-
|
|
|
|
|
/* set up page allocator and slab manager */
|
|
/* set up page allocator and slab manager */
|
|
|
init_slab_mgr(pagesz);
|
|
init_slab_mgr(pagesz);
|
|
|
init_untrusted_slab_mgr();
|
|
init_untrusted_slab_mgr();
|