std: simplify SGX's UnsafeList - #161060
Conversation
|
r? @clarfonthey rustbot has assigned @clarfonthey. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
This is a very intrusive change that changes a lot about the inner workings of the list as well as the list API. I don't really support making this kind of change. |
|
Given that both |
|
The problem is that this needs to be very carefully designed and reviewed because it can easily lead to fundamental concurrency issues if there are any bugs. I don't see a good reason for such an intrusive change given there are much simpler fixes. |
|
I consider the pointer provenance laundering stuff to be a very complicated fix, so I don't think the "there are much simpler fixes" argument really holds. |
|
The entire code can be reviewed and fully understood assuming launder is a no-op. |
Launder is a runtime no-op, but is very significant at compile time as any issues with it will lead to silent miscompilations. |
Fixes #160603
Fixes #114581
This fixes the soundness issues in SGX's
UnsafeListby removing the use of a dummy node in the doubly-linked list, which would have required eitherUnsafePinnedor pointer laundering tricks to make sound (c.f. #160641). In addition, the code is now much more careful when it comes to creating mutable references to whole entries to avoid invalidating any shared borrows of the values when modifying lists.CC @jethrogb