lkml.org 
[lkml]   [2019]   [May]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] fork: do not release lock that wasn't taken
On 05/10, Christian Brauner wrote:
>
> @@ -2102,7 +2102,7 @@ static __latent_entropy struct task_struct *copy_process(
> */
> retval = cgroup_can_fork(p);
> if (retval)
> - goto bad_fork_put_pidfd;
> + goto bad_fork_cgroup_threadgroup_change_end;
>
> /*
> * From this point on we must avoid any synchronous user-space
> @@ -2217,11 +2217,12 @@ static __latent_entropy struct task_struct *copy_process(
> spin_unlock(&current->sighand->siglock);
> write_unlock_irq(&tasklist_lock);
> cgroup_cancel_fork(p);
> +bad_fork_cgroup_threadgroup_change_end:
> + cgroup_threadgroup_change_end(current);
> bad_fork_put_pidfd:
> if (clone_flags & CLONE_PIDFD)
> ksys_close(pidfd);
> bad_fork_free_pid:
> - cgroup_threadgroup_change_end(current);
> if (pid != &init_struct_pid)
> free_pid(pid);
> bad_fork_cleanup_thread:

Reviewed-by: Oleg Nesterov <oleg@redhat.com>

\
 
 \ /
  Last update: 2019-05-10 17:37    [W:1.256 / U:0.000 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site