From: ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org (Eric W. Biederman) Subject: Re: [PATCH] pid: sys_wait... fixes Date: Thu, 06 Dec 2007 10:21:39 -0700 Message-ID: References: <20071206170145.GA10674@tv-sign.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: In-Reply-To: <20071206170145.GA10674-6lXkIZvqkOAvJsYlp49lxw@public.gmane.org> (Oleg Nesterov's message of "Thu, 6 Dec 2007 20:01:45 +0300") List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: Oleg Nesterov Cc: Linux Containers , Andrew Morton , linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Pavel Emelyanov List-Id: containers.vger.kernel.org Oleg Nesterov writes: > On 12/05, Eric W. Biederman wrote: >> >> This modifies do_wait and eligible_child to take a pair of >> enum pid_type and struct pid *pid to precisely specify what >> set of processes are eligible to be waited for, instead of the >> raw pid_t value from sys_wait4. > > Personally, I like this patch very much. Not only it fixes the bug, > in my opinion it also makes the code more clean. > > However at first glance it has a minor fixable problem, > >> + if (type < PIDTYPE_MAX) { >> + if (p->pids[type].pid != pid) >> return 0; >> } > > If type != PIDTYPE_PID we can't trust p->pids[type].pid unless p is a > group leader. This .pid could be just a "random value". Ugh. You are correct. Thanks for the review. That is one annoying special case. Eric