Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 20 Feb 2020 17:37:44 -0600
From: (Eric W. Biederman)
To: Al Viro <>
Cc: Linus Torvalds <>,  LKML <>,  Kernel Hardening <>,  Linux API <>,  Linux FS Devel <>,  Linux Security Module <>,  Akinobu Mita <>,  Alexey Dobriyan <>,  Andrew Morton <>,  Andy Lutomirski <>,  Daniel Micay <>,  Djalal Harouni <>,  "Dmitry V . Levin" <>,  Greg Kroah-Hartman <>,  Ingo Molnar <>,  "J . Bruce Fields" <>,  Jeff Layton <>,  Jonathan Corbet <>,  Kees Cook <>,  Oleg Nesterov <>,  Solar Designer <>
Subject: Re: [PATCH 0/7] proc: Dentry flushing without proc_mnt

Al Viro <> writes:

> On Thu, Feb 20, 2020 at 03:02:22PM -0800, Linus Torvalds wrote:
>> On Thu, Feb 20, 2020 at 12:48 PM Eric W. Biederman
>> <> wrote:
>> >
>> > Linus, does this approach look like something you can stand?
>> A couple of worries, although one of them seem to have already been
>> resolved by Al.
>> I think the real gatekeeper should be Al in general.  But other than
>> the small comments I had, I think this might work just fine.
>> Al?
> I'll need to finish RTFS there; I have initially misread that patch,
> actually - Eric _is_ using that thing both for those directories
> and for sysctl inodes.  And the prototype for that machinery (the
> one he'd pulled from proc_sysctl.c) is playing with pinning superblocks
> way too much; for per-pid directories that's not an issue, but
> for sysctl table removal you are very likely to hit a bunch of
> evictees on the same superblock...

I saw that was possible.  If the broad strokes look correct I don't have
a problem at all with optimizing for the case where many of the entries
are for inodes on the same superblock.  I just had enough other details
on my mind I was afraid if I got a little more clever I would have
introduced a typo somewhere.

I wish I could limit the sysctl parts to just directories, but
unfortunately the sysctl tables don't always give a guarantee that a
directory is what will be removed.  But sysctls do have one name per
inode invarant like fat.  There is no way to express a sysctl
table that doesn't have that invariant.

As for d_find_alias/d_invalidate.

Just for completeness I wanted to write a loop:

	while (dentry = d_find_alias(inode)) {

Unfortunately that breaks on directories, because for directories
d_find_alias turns into d_find_any_alias, and continues to return aliases
even when they are unhashed.

It might be nice to write a cousin of d_prune_aliases call
it d_invalidate_aliases that just does that loop the correct way
in dcache.c


Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.