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] [day] [month] [year] [list]
Message-ID: <aEr20HfFfOz8Y7pA@tardis.local>
Date: Thu, 12 Jun 2025 08:48:32 -0700
From: Boqun Feng <boqun.feng@...il.com>
To: Danilo Krummrich <dakr@...nel.org>
Cc: gregkh@...uxfoundation.org, rafael@...nel.org, ojeda@...nel.org,
	alex.gaynor@...il.com, gary@...yguo.net, bjorn3_gh@...tonmail.com,
	benno.lossin@...ton.me, a.hindborg@...nel.org, aliceryhl@...gle.com,
	tmgross@...ch.edu, chrisi.schrefl@...il.com,
	rust-for-linux@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 3/3] rust: devres: fix race in Devres::drop()

On Thu, Jun 12, 2025 at 05:44:27PM +0200, Danilo Krummrich wrote:
> On Thu, Jun 12, 2025 at 08:24:57AM -0700, Boqun Feng wrote:
> > Thanks for the explanation, and sorry I'm a bit late for the response. I
> > was trying to find a place that we should document this, how about the
> > diff below:
> > 
> > ------------
> > diff --git a/rust/kernel/devres.rs b/rust/kernel/devres.rs
> > index 0f79a2ec9474..c8b9754e411b 100644
> > --- a/rust/kernel/devres.rs
> > +++ b/rust/kernel/devres.rs
> > @@ -31,7 +31,8 @@ struct DevresInner<T> {
> >  /// manage their lifetime.
> >  ///
> >  /// [`Device`] bound resources should be freed when either the resource goes out of scope or the
> > -/// [`Device`] is unbound respectively, depending on what happens first.
> > +/// [`Device`] is unbound respectively, depending on what happens first. And if the resource goes
> > +/// out of scope first, [`Device`] unbinding will wait until the resource being freed.
> 
> I will add
> 
> 	In any case, it is always guaranteed that revoking the device resource
> 	is completed before the corresponding [`Device`] is unbound.
> 
> when applying the patch, if that's fine with you.

Looks good to me, thanks!

Regards,
Boqun

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ