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: <87pq9sdjhn.fsf@xmission.com>
Date:	Fri, 25 May 2012 15:43:48 -0600
From:	ebiederm@...ssion.com (Eric W. Biederman)
To:	Oleg Nesterov <oleg@...hat.com>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	LKML <linux-kernel@...r.kernel.org>,
	Pavel Emelyanov <xemul@...allels.com>,
	Cyrill Gorcunov <gorcunov@...nvz.org>,
	Louis Rilling <louis.rilling@...labs.com>,
	Mike Galbraith <efault@....de>
Subject: Re: [PATCH -mm 1/1] pidns: find_new_reaper() can no longer switch to init_pid_ns.child_reaper

Oleg Nesterov <oleg@...hat.com> writes:

> find_new_reaper() changes pid_ns->child_reaper, see add0d4df
> "pid_ns: zap_pid_ns_processes: fix the ->child_reaper changing".
>
> The original reason has gone away after the previous patch,
> ->children list must be empty after zap_pid_ns_processes().
> However, "can't clear ->child_reaper or leave it alone" is
> still true, and now we can not use init_pid_ns.child_reaper.
>
> __unhash_process() relies on the "->child_reaper == parent"
> check, but this check does not work if the last exiting task
> is also the child reaper.
>
> Change find_new_reaper() to use pid_ns->parent->child_reaper.

Oleg this is a good catch for a real problem.  However I disagree about
the fix.

We should make unhash_process say:
	if ((task_active_pid_ns(parent)->child_reaper == parent) &&
	    list_empty(&parent->children) &&
	    (parent->flags & PF_EXITING))
		wake_up_process(parent);

It is always the child_reaper of our parent's pid namespace that we are
reparented to if our parent exits.  So we were looking at the wrong
processes pid_namespace.  Just using parent removes any need for magic
after zap_pid_ns_processes(), and the test always becomes valid.

And we should just set delete the code after zap_pid_ns_processes that
changes the child_reaper since nothing we will use the child_reaper
after that.  We could set pid_ns.child_reaper to NULL after that
but why bother.

Eric
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ