From: ebiederm@xmission.com (Eric W. Biederman)
To: Oleg Nesterov <oleg@redhat.com>
Cc: Kirill Tkhai <ktkhai@virtuozzo.com>,
mhocko@suse.com, avagin@openvz.org, peterz@infradead.org,
linux-kernel@vger.kernel.org, rppt@linux.vnet.ibm.com,
luto@kernel.org, gorcunov@openvz.org, akpm@linux-foundation.org,
mingo@kernel.org, serge@hallyn.com
Subject: Re: [PATCH v2] pid_ns: Fix race between setns'ed fork() and zap_pid_ns_processes()
Date: Fri, 12 May 2017 11:34:24 -0500 [thread overview]
Message-ID: <87tw4q11bj.fsf@xmission.com> (raw)
In-Reply-To: <20170512161705.GA18742@redhat.com> (Oleg Nesterov's message of "Fri, 12 May 2017 18:17:06 +0200")
Oleg Nesterov <oleg@redhat.com> writes:
> On 05/12, Kirill Tkhai wrote:
>>
> --- a/kernel/fork.c
>> +++ b/kernel/fork.c
>> @@ -1845,11 +1845,13 @@ static __latent_entropy struct task_struct *copy_process(
>> */
>> recalc_sigpending();
>> if (signal_pending(current)) {
>> - spin_unlock(¤t->sighand->siglock);
>> - write_unlock_irq(&tasklist_lock);
>> retval = -ERESTARTNOINTR;
>> goto bad_fork_cancel_cgroup;
>> }
>> + if (unlikely(!(ns_of_pid(pid)->nr_hashed & PIDNS_HASH_ADDING))) {
>> + retval = -ENOMEM;
>> + goto bad_fork_cancel_cgroup;
>> + }
>>
>> if (likely(p->pid)) {
>> ptrace_init_task(p, (clone_flags & CLONE_PTRACE) || trace);
>> @@ -1907,6 +1909,8 @@ static __latent_entropy struct task_struct *copy_process(
>> return p;
>>
>> bad_fork_cancel_cgroup:
>> + spin_unlock(¤t->sighand->siglock);
>> + write_unlock_irq(&tasklist_lock);
>> cgroup_cancel_fork(p);
>
> Looks good to me.
Oleg can I have a review or acked by?
Then I will queue this up.
Eric
next prev parent reply other threads:[~2017-05-12 16:40 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-12 16:11 [PATCH v2] pid_ns: Fix race between setns'ed fork() and zap_pid_ns_processes() Kirill Tkhai
2017-05-12 16:17 ` Oleg Nesterov
2017-05-12 16:34 ` Eric W. Biederman [this message]
2017-05-12 17:05 ` Oleg Nesterov
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=87tw4q11bj.fsf@xmission.com \
--to=ebiederm@xmission.com \
--cc=akpm@linux-foundation.org \
--cc=avagin@openvz.org \
--cc=gorcunov@openvz.org \
--cc=ktkhai@virtuozzo.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=mhocko@suse.com \
--cc=mingo@kernel.org \
--cc=oleg@redhat.com \
--cc=peterz@infradead.org \
--cc=rppt@linux.vnet.ibm.com \
--cc=serge@hallyn.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.