[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20181204091736.GD73770@gmail.com>
Date: Tue, 4 Dec 2018 10:17:36 +0100
From: Ingo Molnar <mingo@...nel.org>
To: Oleg Nesterov <oleg@...hat.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>,
Linux List Kernel Mailing <linux-kernel@...r.kernel.org>,
"Rafael J. Wysocki" <rafael.j.wysocki@...el.com>,
Chanho Min <chanho.min@....com>,
Thomas Gleixner <tglx@...utronix.de>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Pavel Machek <pavel@....cz>, Michal Hocko <mhocko@...e.com>
Subject: Re: [PATCH] Revert "exec: make de_thread() freezable (was: Re: Linux
4.20-rc4)
* Oleg Nesterov <oleg@...hat.com> wrote:
> > I reviewed the ->cred_guard_mutex code, and the mutex is held across all
> > of exec() - and we always did this.
>
> Yes, and this was always wrong. For example, this test-case hangs:
>
> #include <unistd.h>
> #include <signal.h>
> #include <sys/ptrace.h>
> #include <pthread.h>
>
> void *thread(void *arg)
> {
> ptrace(PTRACE_TRACEME, 0,0,0);
> return NULL;
> }
>
> int main(void)
> {
> int pid = fork();
>
> if (!pid) {
> pthread_t pt;
> pthread_create(&pt, NULL, thread, NULL);
> pthread_join(pt, NULL);
> execlp("echo", "echo", "passed", NULL);
> }
>
> sleep(1);
> // or anything else which needs ->cred_guard_mutex,
> // say open(/proc/$pid/mem)
> ptrace(PTRACE_ATTACH, pid, 0,0);
> kill(pid, SIGCONT);
>
> return 0;
> }
>
> we really need to narrow the (huge) scope of ->cred_guard_mutex in exec paths.
>
> my attempt to fix this was nacked, and nobody suggested a better solution so far.
Any link to your patch and the NAK?
Thanks,
Ingo
Powered by blists - more mailing lists