lkml.org 
[lkml]   [2021]   [Dec]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] exit: Retain nsproxy for exit_task_work() work entries
Hello, Eric.

On Wed, Dec 08, 2021 at 12:45:54PM -0600, Eric W. Biederman wrote:
> Permission checks on files need to happen at open time, not at
> write time. It is all too easy to confuse something that writes
> to stdout to write to a file of your choosing to make permission
> checking at write time a good idea.

Whether a given operation is allowed or not is dependent on the content of
the write. I don't see how it can be moved to open time. I'm not a fan of
the fs based interface but they're not real files and it has been like this
from the beginning.

> That said I can't quite tell if the test should be moved into
> cgroup_file_open or if there is a permission entry that would work.

It can't.

> I may be wrong but at first glance this looks like the cgroup code is
> going to need significant surgery to get the permission checks happening
> at open time where they belong.

There's no way to change that without changing the interface drastically.

> Please don't apply this patch.
>
> exit_task_work running after exit_task_namespaces is the messenger
> that just told us about something ugly.

I don't see good alternatives here. You got any?

Thanks.

--
tejun

\
 
 \ /
  Last update: 2021-12-08 20:07    [W:0.073 / U:0.896 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site