-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix memory management for cloned threads.
We were not serialising deallocation of the thread with the Linux scheduler. This caused some use-after free errors when, in some situations, the kernel could try to manipulate the deallocated scheduler semaphore. The fix treats cloned threads as kernel threads. The kernel already gets the dying thread to a quiescence point and enters the scheduler, just as it does for kernel threads. We reuse that logic with a minor modification: we need to prevent the TLS destructor associated with the host thread from running, so that the exit call does not attempt to make the thread exit again. Fixes lsds/sgx-lkl#686
- Loading branch information
1 parent
537cfbf
commit 10989b0
Showing
1 changed file
with
43 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters