linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: "Michal Koutný" <mkoutny@suse.com>
Cc: linux-kernel@vger.kernel.org, Jens Axboe <axboe@kernel.dk>,
	Kees Cook <keescook@chromium.org>,
	Oleg Nesterov <oleg@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Jim Newsome <jnewsome@torproject.org>,
	Alexey Gladkov <legion@kernel.org>, Tejun Heo <tj@kernel.org>,
	security@kernel.org, Andy Lutomirski <luto@amacapital.net>,
	Jann Horn <jannh@google.com>
Subject: Re: [PATCH] exit: Retain nsproxy for exit_task_work() work entries
Date: Mon, 13 Dec 2021 09:24:55 -0600	[thread overview]
Message-ID: <874k7c34u0.fsf@email.froward.int.ebiederm.org> (raw)
In-Reply-To: <YbPe4+K+RlDgccIh@blackbook> ("Michal \=\?utf-8\?Q\?Koutn\=C3\=BD\?\= \=\?utf-8\?Q\?\=22's\?\= message of "Sat, 11 Dec 2021 00:12:35 +0100")

Michal Koutný <mkoutny@suse.com> writes:

> On Wed, Dec 08, 2021 at 12:45:54PM -0600, "Eric W. Biederman" <ebiederm@xmission.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

      reply	other threads:[~2021-12-13 15:25 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-08 18:05 [PATCH] exit: Retain nsproxy for exit_task_work() work entries Michal Koutný
2021-12-08 18:45 ` Eric W. Biederman
2021-12-08 19:06   ` Tejun Heo
2021-12-08 19:39     ` Linus Torvalds
2021-12-08 19:49       ` Tejun Heo
2021-12-08 23:07         ` Tejun Heo
2021-12-09 13:44           ` Michal Koutný
2021-12-09 14:08             ` Christian Brauner
2021-12-09 14:47               ` Michal Koutný
2021-12-09 15:06                 ` Christian Brauner
2021-12-09 16:39                   ` Michal Koutný
2021-12-10 23:12   ` Michal Koutný
2021-12-13 15:24     ` Eric W. Biederman [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874k7c34u0.fsf@email.froward.int.ebiederm.org \
    --to=ebiederm@xmission.com \
    --cc=axboe@kernel.dk \
    --cc=jannh@google.com \
    --cc=jnewsome@torproject.org \
    --cc=keescook@chromium.org \
    --cc=legion@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=mkoutny@suse.com \
    --cc=oleg@redhat.com \
    --cc=peterz@infradead.org \
    --cc=security@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=tj@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).