From: Danilo Krummrich <dakr@kernel.org>
To: lossin@kernel.org, gary@garyguo.net, ojeda@kernel.org,
boqun@kernel.org, bjorn3_gh@protonmail.com,
a.hindborg@kernel.org, aliceryhl@google.com, tmgross@umich.edu,
daniel.almeida@collabora.com, tamird@kernel.org,
acourbot@nvidia.com, work@onurozkan.dev, lyude@redhat.com,
deborah.brouwer@collabora.com
Cc: rust-for-linux@vger.kernel.org, driver-core@lists.linux.dev,
Danilo Krummrich <dakr@kernel.org>
Subject: [PATCH 0/2] rust: revocable: fix potential race between concurrent revokers
Date: Thu, 18 Jun 2026 21:32:57 +0200 [thread overview]
Message-ID: <20260618193951.601239-1-dakr@kernel.org> (raw)
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/20260612194436.585385-5-lyude@redhat.com/
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
--
2.54.0
next reply other threads:[~2026-06-18 19:39 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-18 19:32 Danilo Krummrich [this message]
2026-06-18 19:32 ` [PATCH 1/2] pin-init: add PinInit::map_err() for error type conversion Danilo Krummrich
2026-06-18 19:32 ` [PATCH 2/2] rust: revocable: fix race between concurrent revokers Danilo Krummrich
2026-06-18 21:35 ` Boqun Feng
2026-06-18 22:24 ` Danilo Krummrich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260618193951.601239-1-dakr@kernel.org \
--to=dakr@kernel.org \
--cc=a.hindborg@kernel.org \
--cc=acourbot@nvidia.com \
--cc=aliceryhl@google.com \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun@kernel.org \
--cc=daniel.almeida@collabora.com \
--cc=deborah.brouwer@collabora.com \
--cc=driver-core@lists.linux.dev \
--cc=gary@garyguo.net \
--cc=lossin@kernel.org \
--cc=lyude@redhat.com \
--cc=ojeda@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=tamird@kernel.org \
--cc=tmgross@umich.edu \
--cc=work@onurozkan.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox