[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250507212329.GY2023217@ZenIV>
Date: Wed, 7 May 2025 22:23:29 +0100
From: Al Viro <viro@...iv.linux.org.uk>
To: Paul Moore <paul@...l-moore.com>
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 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)...
Powered by blists - more mailing lists