Add advisory for double-free in sys-info

This commit is contained in:
ABGH, C
2021-01-19 16:27:16 -06:00
parent 6a17b914ad
commit ad82bc5daa

View File

@@ -0,0 +1,27 @@
```toml
[advisory]
id = "RUSTSEC-0000-0000"
package = "sys-info"
date = "2020-01-19"
url = "https://github.com/FillZpp/sys-info-rs/issues/63"
categories = ["memory-corruption"]
keywords = ["concurrency", "double free"]
[versions]
patched = []
unaffected = []
[affected]
os = ["linux"]
functions = { "sys_info::disk_info" = ["<= 0.1.1"] }
```
# Double free when calling `sys_info::disk_info` from multiple threads
Affected versions of `sys-info` use a static, global, list to store temporary disk information while running. The function that cleans up this list,
`DFCleanup`, assumes a single threaded environment and will try to free the same memory twice in a multithreaded environment.
This results in consistent double-frees and segfaults when calling `sys_info::disk_info` from multiple threads at once.
## Safer Alternatives:
- [`sysinfo`](https://crates.io/crates/sysinfo)