Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
934: Fix a use-after-free race in SpinLatch::set, and release 1.9.3 r=cuviper a=cuviper `SpinLatch<'r>` borrows `&'r Arc<Registry>` from the `WorkerThread` where it is created. When we `set`, we're careful to make sure that the `Registry` remains alive while we do the inner `set` and then `notify_worker_latch_is_set`. We knew from past bugs that the `SpinLatch` could be invalidated between set and notify, but the `&Arc` could also be invalidated if the target thread sees the set *and exits* (dropping its `WorkerThread`) before the notification. That's a fairly long race, but preemption could make that happen. The inner `Registry` will still be alive, since the current thread is part of that pool, so we can hold that reference directly. Fixes #913 Fixes #929 Co-authored-by: Josh Stone <cuviper@gmail.com>
- Loading branch information
Showing
8 changed files
with
206 additions
and
178 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
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
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
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
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