[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <874k7c34u0.fsf@email.froward.int.ebiederm.org>
Date: Mon, 13 Dec 2021 09:24:55 -0600
From: ebiederm@...ssion.com (Eric W. Biederman)
To: Michal Koutný <mkoutny@...e.com>
Cc: linux-kernel@...r.kernel.org, Jens Axboe <axboe@...nel.dk>,
Kees Cook <keescook@...omium.org>,
Oleg Nesterov <oleg@...hat.com>,
Peter Zijlstra <peterz@...radead.org>,
Thomas Gleixner <tglx@...utronix.de>,
Jim Newsome <jnewsome@...project.org>,
Alexey Gladkov <legion@...nel.org>, Tejun Heo <tj@...nel.org>,
security@...nel.org, Andy Lutomirski <luto@...capital.net>,
Jann Horn <jannh@...gle.com>
Subject: Re: [PATCH] exit: Retain nsproxy for exit_task_work() work entries
Michal Koutný <mkoutny@...e.com> writes:
> On Wed, Dec 08, 2021 at 12:45:54PM -0600, "Eric W. Biederman" <ebiederm@...ssion.com> wrote:
>> TL;DR the cgroup file system is checking permissions at write time.
>
> Thank you for bringing that up (handled in a separate thread now).
>
>> I think I follow your reasoning and I think it will even fix the issue
>> but no.
>
> FTR, part of Tejun's series [1] ensures that cgroup_ns is accessed
> directly without nsproxy and a reference to it is kept while the file
> is opened. I.e. that'd properly fix this particular crash reported by
> syzbot.
>
>> Please don't apply this patch.
>>
>> exit_task_work running after exit_task_namespaces is the messenger
>> that just told us about something ugly.
>
> In (my) theory some other task_work callbacks could (transitively) rely
> on the current->nsproxy which could still be cleared by
> exit_task_namespaces().
> Is there another reason why to have exit_task_namespaces() before
> exit_task_work()?
We already have the principle that things are going to be cleaned up
before exit_task_work is called and exit_files depends upon that.
So I think the burden is to find a good reason why exit_task_work should
move not to defend it.
If we don't want things cleaned up before exit_task_work it should come
at the start of do_exit and exit_files and others need to stop depending
upon it. Which seems like challenging change to make.
Eric
Powered by blists - more mailing lists