Skip to content

Commit

Permalink
Fix bug in initialisation sequence
Browse files Browse the repository at this point in the history
  • Loading branch information
prp committed Aug 20, 2020
1 parent a9cfbc7 commit 147866e
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/enclave/enclave_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,14 @@ static int app_main_thread(void* args)
pthread_t self = __pthread_self();
self->locale = &libc.global_locale;

init_wireguard_peers();

find_and_mount_disks();

/* Launch stage 3 dynamic linker, passing in top of stack to overwrite.
* The dynamic linker will then load the application proper; here goes! */
SGXLKL_VERBOSE("Invoking dynamic loader (stage 3)\n");
__dls3(&sgxlkl_enclave_state.elf64_stack, __builtin_frame_address(0));

SGXLKL_VERBOSE("done\n");
}

static int kernel_main_thread(void* args)
Expand All @@ -127,9 +129,6 @@ static int kernel_main_thread(void* args)
lkl_start_init();

lthread_set_funcname(lthread_self(), "sgx-lkl-init");
init_wireguard_peers();

find_and_mount_disks();

struct lthread* lt;
if (lthread_create(&lt, NULL, app_main_thread, NULL) != 0)
Expand Down

0 comments on commit 147866e

Please sign in to comment.