rust: revocable: fix potential race between concurrent revokers
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest2 patches 3 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | pin-init: add PinInit::map_err() for error type conversionrust/ | +44 | 0 replies | |
| 2/2 | rust: revocable: fix race between concurrent revokersrust/ | +20 | 3 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/2] rust: revocable: fix potential race between concurrent revokers
Fix a race condition caused by not considering that Revocable does not guarantee the wrapped object has been fully dropped by the time revoke() or revoke_nosync() returns false.
There is currently no actual bug caused by this, but it causes SGTable and Lyude's patch in [1] to be unsound.
Since Completion::new() is infallible but Revocable::new() is generic over the error type, the first patch adds PinInit::map_err() to bridge the error type mismatch.
This can either go separately or together with Lyude's patch. Both cases are unlikely to ever hit this problem, so it should be fine either way.
[1] https://lore.kernel.org/dri-devel/[email protected]/
Danilo Krummrich (2):
pin-init: add PinInit::map_err() for error type conversion
rust: revocable: fix race between concurrent revokers
rust/kernel/revocable.rs | 23 ++++++++++++++++++--- rust/pin-init/src/lib.rs | 44 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+), 3 deletions(-)
base-commit: 66affa37cfac0aec061cc4bcf4a065b0c52f7e19
Signature · 1 line
2.54.0