Skip to content

Commit ce8badf

Browse files
authored
Add crossbeam-channel advisory re upstream MR #1187 (#2277)
1 parent fcb3400 commit ce8badf

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
```toml
2+
[advisory]
3+
id = "RUSTSEC-0000-0000"
4+
package = "crossbeam-channel"
5+
date = "2025-04-08"
6+
url = "https://github.com/crossbeam-rs/crossbeam/pull/1187"
7+
categories = ["memory-corruption"]
8+
keywords = ["race"]
9+
aliases = ["TROVE-2025-013"]
10+
11+
[versions]
12+
patched = [">= 0.5.15"]
13+
unaffected = ["<= 0.5.11"]
14+
```
15+
16+
# crossbeam-channel: double free on Drop
17+
18+
The internal `Channel` type's `Drop` method has a race
19+
which could, in some circumstances, lead to a double-free.
20+
This could result in memory corruption.
21+
22+
Quoting from the
23+
[upstream description in merge request \#1187](https://github.com/crossbeam-rs/crossbeam/pull/1187#issue-2980761131):
24+
25+
> The problem lies in the fact that `dicard_all_messages` contained two paths that could lead to `head.block` being read but only one of them would swap the value. This meant that `dicard_all_messages` could end up observing a non-null block pointer (and therefore attempting to free it) without setting `head.block` to null. This would then lead to `Channel::drop` making a second attempt at dropping the same pointer.
26+
27+
The bug was introduced while fixing a memory leak, in
28+
upstream [MR \#1084](https://github.com/crossbeam-rs/crossbeam/pull/1084),
29+
first published in 0.5.12.
30+
31+
The fix is in
32+
upstream [MR \#1187](https://github.com/crossbeam-rs/crossbeam/pull/1187)
33+
and has been published in 0.5.15

0 commit comments

Comments
 (0)