-
Notifications
You must be signed in to change notification settings - Fork 377
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add advisory for double-free in scratchpad
- Loading branch information
1 parent
1794cae
commit e59320a
Showing
1 changed file
with
26 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
```toml | ||
[advisory] | ||
id = "RUSTSEC-0000-0000" | ||
package = "scratchpad" | ||
date = "2021-02-18" | ||
url = "https://github.com/okready/scratchpad/issues/1" | ||
categories = ["memory-corruption"] | ||
keywords = ["memory-safety", "double-free"] | ||
|
||
[versions] | ||
patched = [">= 1.3.1"] | ||
|
||
[affected] | ||
functions = { "scratchpad::SliceMoveSource::move_elements" = ["< 1.3.1"] } | ||
``` | ||
|
||
# move_elements can double-free objects on panic | ||
|
||
Affected versions of `scratchpad` used `ptr::read` to read elements while | ||
calling a user provided function `f` on them. | ||
|
||
Since the pointer read duplicates ownership, a panic inside the user provided | ||
`f` function could cause a double free when unwinding. | ||
|
||
The flaw was fixed in commit `891561bea` by removing the unsafe block and using | ||
a plain iterator. |