lkml.org 
[lkml]   [2024]   [Apr]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [GIT PULL] security changes for v6.9-rc3
On Tue, Apr 2, 2024 at 4:27 PM Paul Moore <paul@paul-moore.com> wrote:
> On Tue, Apr 2, 2024 at 3:39 PM Linus Torvalds
> <torvalds@linux-foundation.org> wrote:
> >
>
> ...
>
> > But if we really want to do this ("if mknod creates a positive dentry,
> > I won't see it in lookup, so I want to appraise it now"), then we
> > should just deal with this in the generic layer with some hack like
> > this:
> >
> > --- a/security/security.c
> > +++ b/security/security.c
> > @@ -1801,7 +1801,8 @@ EXPORT_SYMBOL(security_path_mknod);
> > */
> > void security_path_post_mknod(struct mnt_idmap *idmap, struct dentry *dentry)
> > {
> > - if (unlikely(IS_PRIVATE(d_backing_inode(dentry))))
> > + struct inode *inode = d_backing_inode(dentry);
> > + if (unlikely(!inode || IS_PRIVATE(inode)))
> > return;
> > call_void_hook(path_post_mknod, idmap, dentry);
> > }
>
> Other than your snippet wrapping both the inode/NULL and
> inode/IS_PRIVATE checks with an unlikely(), that's what Roberto
> submitted (his patch only wrapped the inode/IS_PRIVATE with unlikely).

Nevermind, I missed the obvious OR / AND diff ... sorry for the noise.

--
paul-moore.com

\
 
 \ /
  Last update: 2024-05-27 16:20    [W:0.085 / U:0.564 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site