lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87tw4q11bj.fsf@xmission.com>
Date:   Fri, 12 May 2017 11:34:24 -0500
From:   ebiederm@...ssion.com (Eric W. Biederman)
To:     Oleg Nesterov <oleg@...hat.com>
Cc:     Kirill Tkhai <ktkhai@...tuozzo.com>, mhocko@...e.com,
        avagin@...nvz.org, peterz@...radead.org,
        linux-kernel@...r.kernel.org, rppt@...ux.vnet.ibm.com,
        luto@...nel.org, gorcunov@...nvz.org, akpm@...ux-foundation.org,
        mingo@...nel.org, serge@...lyn.com
Subject: Re: [PATCH v2] pid_ns: Fix race between setns'ed fork() and zap_pid_ns_processes()

Oleg Nesterov <oleg@...hat.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(&current->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(&current->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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ