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: <20250210115313.69299472@gandalf.local.home>
Date: Mon, 10 Feb 2025 11:53:13 -0500
From: Steven Rostedt <rostedt@...dmis.org>
To: David Reaver <me@...idreaver.com>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>, "Rafael J . Wysocki"
 <rafael@...nel.org>, Danilo Krummrich <dakr@...nel.org>, Christian Brauner
 <brauner@...nel.org>, Alexander Viro <viro@...iv.linux.org.uk>,
 linux-fsdevel@...r.kernel.org, cocci@...ia.fr, linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH 0/6] debugfs: Replace dentry with an opaque handle
 in debugfs API

On Mon, 10 Feb 2025 08:08:25 -0800
David Reaver <me@...idreaver.com> wrote:

> Greg Kroah-Hartman <gregkh@...uxfoundation.org> writes:
> 
> >
> > First off, many thanks for attempting this, I didn't think it was ready
> > to even be attempted, so it's very nice to see this.
> >  
> 
> No problem, and thank you for taking a look!
> 
> > That being said, I agree with Al, we can't embed a dentry in a structure
> > like that as the lifecycles are going to get messy fast.
> >  
> 
> Ack, I'll do something different in v2.
> 
> For my own education: what goes wrong with lifecycles with this embed?
> Feel free to point me at a doc or something.
> 
> Also, Al and Greg, would wrapping a pointer be fine?
> 
> 	struct debugfs_node {
> 		struct dentry *dentry;
> 	};

No it will not be fine. You should not be using dentry at all. I thought
this was going to convert debugfs over to kernfs. The debugfs_node should
be using kernfs and completely eliminate the use of dentry.


> 
> I was trying to do the simplest thing possible so the bulk of the change
> was mechanical. Wrapping a pointer is slightly more complicated because
> we have to deal with memory allocation, but it is still totally doable.
> 
> > Also, your replacement of many of the dentry functions with wrappers
> > seems at bit odd, ideally you would just return a dentry from a call
> > like "debugfs_node_to_dentry()" and then let the caller do with it what
> > it wants to, that way you don't need to wrap everything.

What caller should ever touch a dentry? What I got from my "conversation"
with Linus, is that dentry is an internal caching descriptor of the VFS
layer, and should only be used by the VFS layer. Nothing outside of VFS
should ever need a dentry.

-- Steve

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ