lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <DAWID96TPD6Y.24T1VWNHUYYLN@kernel.org>
Date: Thu, 26 Jun 2025 15:44:31 +0200
From: "Benno Lossin" <lossin@...nel.org>
To: "Danilo Krummrich" <dakr@...nel.org>, <gregkh@...uxfoundation.org>,
 <rafael@...nel.org>, <ojeda@...nel.org>, <alex.gaynor@...il.com>,
 <boqun.feng@...il.com>, <gary@...yguo.net>, <bjorn3_gh@...tonmail.com>,
 <a.hindborg@...nel.org>, <aliceryhl@...gle.com>, <tmgross@...ch.edu>
Cc: <rust-for-linux@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] rust: devres: require T: Send for Devres

On Thu Jun 26, 2025 at 3:24 PM CEST, Danilo Krummrich wrote:
> Due to calling Revocable::revoke() from Devres::devres_callback() T may
> be dropped from Devres::devres_callback() and hence must be Send.
>
> Fix this by adding the corresponding bound to Devres and DevresInner.
>
> Reported-by: Boqun Feng <boqun.feng@...il.com>
> Closes: https://lore.kernel.org/lkml/aFzI5L__OcB9hqdG@Mac.home/
> Fixes: 76c01ded724b ("rust: add devres abstraction")
> Signed-off-by: Danilo Krummrich <dakr@...nel.org>
> ---
>  rust/kernel/devres.rs | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)

It would be enough to require `Send` on all `impl` blocks and not on the
struct itself. Normally, I recommend doing that, because then you can
have types like `Foo<Invalid>` existing when they come up in some weird
type. But in this case, I think it's fine to add it to the type
definition.

Reviewed-by: Benno Lossin <lossin@...nel.org>

---
Cheers,
Benno

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ