From: Richard Guy Briggs Subject: Re: [PATCH 5/7] pid: rewrite task helper function is_global_init() avoiding task->pid Date: Fri, 21 Feb 2014 11:10:58 -0500 Message-ID: <20140221161058.GY16640@madcap2.tricolour.ca> References: <20140220183958.GB23993@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <20140220183958.GB23993@redhat.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-audit-bounces@redhat.com Errors-To: linux-audit-bounces@redhat.com To: Oleg Nesterov Cc: peterz@infradead.org, linux-kernel@vger.kernel.org, linux-audit@redhat.com, "Eric W. Biederman" , akpm@linux-foundation.org List-Id: linux-audit@redhat.com On 14/02/20, Oleg Nesterov wrote: > On 01/23, Richard Guy Briggs wrote: > > > > static inline int is_global_init(struct task_struct *tsk) > > { > > - return tsk->pid == 1; > > + return task_pid_nr(tsk) == 1; > > } > > ACK, but we need to fix it. > > With or without this change is_global_init() actually means > is-the-main-thread-of-global-init. > > This is not what the callers actually want. Just look at > oom_unkillable_task(). Suppose that p is the sub-thread of > /sbin/init, if we kill this thread we kill the whole process. > > The same of other callers. is_global_init() should return T > if this task is the part of init's thread group. Good. Updated in my tree. > Oleg. - RGB -- Richard Guy Briggs Senior Software Engineer, Kernel Security, AMER ENG Base Operating Systems, Red Hat Remote, Ottawa, Canada Voice: +1.647.777.2635, Internal: (81) 32635, Alt: +1.613.693.0684x3545