lkml.org 
[lkml]   [2018]   [Dec]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] Revert "exec: make de_thread() freezable (was: Re: Linux 4.20-rc4)

* Oleg Nesterov <oleg@redhat.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

\
 
 \ /
  Last update: 2018-12-04 10:18    [W:0.124 / U:4.028 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site