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: <487552320d1b854769797cd8c4c5c95cfc1248ff.camel@nvidia.com>
Date: Thu, 1 May 2025 16:44:01 +0000
From: Timur Tabi <ttabi@...dia.com>
To: "gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
	"mmaurer@...gle.com" <mmaurer@...gle.com>
CC: "tmgross@...ch.edu" <tmgross@...ch.edu>, "benno.lossin@...ton.me"
	<benno.lossin@...ton.me>, "rafael@...nel.org" <rafael@...nel.org>,
	"gary@...yguo.net" <gary@...yguo.net>, "a.hindborg@...nel.org"
	<a.hindborg@...nel.org>, "rust-for-linux@...r.kernel.org"
	<rust-for-linux@...r.kernel.org>, "bjorn3_gh@...tonmail.com"
	<bjorn3_gh@...tonmail.com>, "boqun.feng@...il.com" <boqun.feng@...il.com>,
	"dakr@...nel.org" <dakr@...nel.org>, "alex.gaynor@...il.com"
	<alex.gaynor@...il.com>, "aliceryhl@...gle.com" <aliceryhl@...gle.com>,
	"ojeda@...nel.org" <ojeda@...nel.org>, "linux-kernel@...r.kernel.org"
	<linux-kernel@...r.kernel.org>, "samitolvanen@...gle.com"
	<samitolvanen@...gle.com>
Subject: Re: [PATCH v2 4/4] rust: samples: Add debugfs sample

On Thu, 2025-05-01 at 09:40 +0200, Greg Kroah-Hartman wrote:
> On Wed, Apr 30, 2025 at 11:31:59PM +0000, Matthew Maurer wrote:
> > Provides an example of using the Rust DebugFS bindings.
> > 
> > Signed-off-by: Matthew Maurer <mmaurer@...gle.com>
> 
> Much nicer, many thanks for this!
> 
> Some minor comments on the sample code here.  As someone coming from C
> with limited Rust experience, I think I do understand it, but I think it
> could use a bunch of comments to make it more "obvious" what is
> happening, see below.

Agree 100%.  I'm using this patch set to learn more about R4L.

> > +static EXAMPLE: AtomicU32 = AtomicU32::new(8);
> 
> Wait, why is this set to 8 and then you automatically set it to 10 after
> you create the file?  No one is ever going to see 8 as a valid value
> unless they really race to read the file, right?

Well, it does show that the driver still has the ability to write to EXAMPLE even after the debugfs
entry is created.  That demonstrates that the driver retains ownership, which is a useful test for
any debugfs implementation.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ