[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHC9VhScmdZLz7W=FN+mfWjf5LB7jbTJm5g-iy35hvvMgbKRfQ@mail.gmail.com>
Date: Wed, 7 May 2025 18:12:58 -0400
From: Paul Moore <paul@...l-moore.com>
To: Al Viro <viro@...iv.linux.org.uk>
Cc: alexjlzheng@...il.com, Fan Wu <wufan@...ux.microsoft.com>, jmorris@...ei.org,
serge@...lyn.com, greg@...ah.com, chrisw@...l.org,
linux-security-module@...r.kernel.org, linux-kernel@...r.kernel.org,
Jinliang Zheng <alexjlzheng@...cent.com>
Subject: Re: [PATCH v2] securityfs: fix missing of d_delete() in securityfs_remove()
On Wed, May 7, 2025 at 5:23 PM Al Viro <viro@...iv.linux.org.uk> wrote:
> On Wed, May 07, 2025 at 04:10:11PM -0400, Paul Moore wrote:
> > > In addition, securityfs_recursive_remove() avoids this problem by calling
> > > __d_drop() directly. As a non-recursive version, it is somewhat strange
> > > that securityfs_remove() does not clean up the deleted dentry.
> > >
> > > Fix this by adding d_delete() in securityfs_remove().
> >
> > I wondering why we don't simply replace all instances of
> > securityfs_remove() with securityfs_recursive_remove(), or more likely
> > just remove the existing securityfs_remove() and rename the
> > securityfs_recursive_remove() to securityfs_remove(). Do any existing
> > LSMs rely on securityfs_remove() *not* acting recursively?
>
> It's a bit trickier than that (there are interesting issues around
> efi_secret_unlink() nonsense, as well as insane refcounting grabbing
> two references where only one is needed to pin the damn thing)...
Fun :/
In that case, what do you think of the change suggested here by
Jinliang Zheng where we add a d_delete() to the existing
securityfs_remove() implementation?
--
paul-moore.com
Powered by blists - more mailing lists