lkml.org 
[lkml]   [2020]   [May]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] securityfs: Add missing d_delete() call on removal
On Wed, May 06, 2020 at 02:14:31AM +0100, Al Viro wrote:
> On Tue, May 05, 2020 at 04:40:35PM -0700, Kees Cook wrote:
> > After using simple_unlink(), a call to d_delete() is needed in addition
> > to dput().
> >
> > Signed-off-by: Kees Cook <keescook@chromium.org>
> > ---
> > Is this correct? I went looking around and there are a lot of variations
> > on the simple_unlink() pattern...
> >
> > Many using explicit locking and combinations of d_drop(), __d_drop(), etc.
>
> Quite a few of those should switch to simple_recursive_removal(). As for
> securityfs... d_drop() is _probably_ a saner variant, but looking at the
> callers of that thing... at least IMA ones seem to be garbage.

Hmm, I dunno. I hadn't looked at these yet. I'm not sure what's needed
for those cases.

Is my patch to add d_delete() correct, though? I'm trying to construct
the right set of calls for pstore's filesystem, and I noticed that most
will do simple_unlink(), d_delete(), dput(), but securityfs seemed to be
missing it.

--
Kees Cook

\
 
 \ /
  Last update: 2020-05-06 05:29    [W:0.111 / U:1.348 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site