Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sat, 25 Jan 2020 10:45:25 -0800
From: Linus Torvalds <>
To: Alexey Gladkov <>
Cc: LKML <>, 
	Kernel Hardening <>, Linux API <>, 
	Linux FS Devel <>, 
	Linux Security Module <>, 
	Akinobu Mita <>, Alexander Viro <>, 
	Alexey Dobriyan <>, Andrew Morton <>, 
	Andy Lutomirski <>, Daniel Micay <>, 
	Djalal Harouni <>, "Dmitry V . Levin" <>, 
	"Eric W . Biederman" <>, Greg Kroah-Hartman <>, 
	Ingo Molnar <>, "J . Bruce Fields" <>, 
	Jeff Layton <>, Jonathan Corbet <>, 
	Kees Cook <>, Oleg Nesterov <>, 
	Solar Designer <>, Stephen Rothwell <>
Subject: Re: [PATCH v7 07/11] proc: flush task dcache entries from all procfs instances

On Sat, Jan 25, 2020 at 5:06 AM Alexey Gladkov <> wrote:
> This allows to flush dcache entries of a task on multiple procfs mounts
> per pid namespace.

>From a quick read-through, this is the only one I really react negatively to.

The locking looks odd. It only seems to protect the new proc_mounts
list, but then it's a whole big rwsem, and it's taken over all of
proc_flush_task_mnt(), and the locking is exported to all over as a
result of that - including the dummy functions for "there is no proc"

And proc_flush_task_mnt() itself should need no locking over any of
it, so it's all just for the silly looping over the list.


 (a) this looks fishy and feels wrong - I get a very strong feeling
that the locking is wrong to begin with, and could/should have been
done differently

 (b) all the locking should have been internal to /proc, and those
wrappers shouldn't exist in a common header file (and certainly not
for the non-proc case).

Yes, (a) is just a feeling, and I don't have any great suggestions.
Maybe make it an RCU list and use a spinlock for updating it?

But (b) is pretty much a non-starter in this form. Those wrappers
shouldn't be in a globally exported core header file. No way.


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.