Re: [PATCH] audit_tree: keep inode pinned

From: Richard Guy Briggs
Date: Wed Nov 12 2014 - 12:30:18 EST


On 14/11/05, Miklos Szeredi wrote:
> On Wed, Nov 5, 2014 at 5:58 PM, Richard Guy Briggs <rgb@xxxxxxxxxx> wrote:
> > On 14/11/04, Miklos Szeredi wrote:
> >> From: Miklos Szeredi <mszeredi@xxxxxxx>
> >
> > Hi Miklos,
> >
> >> Audit rules disappear when an inode they watch is evicted from the cache.
> >> This is likely not what we want.
> >>
> >> The guilty commit is "fsnotify: allow marks to not pin inodes in core",
> >> which didn't take into account that audit_tree adds watches with a zero
> >> mask.
> >>
> >> Adding any mask should fix this.
> >
> > Nice find! Do you have a quick reproducer to detect this?
>
> - reboot
> - add tree rule
> - echo 2 > /proc/sys/vm/drop_caches
>
> drop_caches doesn't guarantee dropping the inode from the cache, but
> after a reboot it usually does.

Perfect, thanks! That works as expected. While I was at it, I checked
the audit_watch code and the pending "filter on process name" patches to
make sure they didn't have the same problem.

> Thanks,
> Miklos

- RGB

--
Richard Guy Briggs <rbriggs@xxxxxxxxxx>
Senior Software Engineer, Kernel Security, AMER ENG Base Operating Systems, Red Hat
Remote, Ottawa, Canada
Voice: +1.647.777.2635, Internal: (81) 32635, Alt: +1.613.693.0684x3545
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/