Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750702AbWAaIuq (ORCPT ); Tue, 31 Jan 2006 03:50:46 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1750704AbWAaIuq (ORCPT ); Tue, 31 Jan 2006 03:50:46 -0500 Received: from mail.tv-sign.ru ([213.234.233.51]:53958 "EHLO several.ru") by vger.kernel.org with ESMTP id S1750702AbWAaIuq (ORCPT ); Tue, 31 Jan 2006 03:50:46 -0500 Message-ID: <43DF36EF.C38E6C4B@tv-sign.ru> Date: Tue, 31 Jan 2006 13:07:43 +0300 From: Oleg Nesterov X-Mailer: Mozilla 4.76 [en] (X11; U; Linux 2.2.20 i686) X-Accept-Language: en MIME-Version: 1.0 To: "Eric W. Biederman" Cc: Andrew Morton , linux-kernel@vger.kernel.org Subject: Re: [PATCH] exec: Cleanup exec from a non thread group leader. References: <43DDFDE3.58C01234@tv-sign.ru> <43DE2730.795468DC@tv-sign.ru> Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1534 Lines: 43 "Eric W. Biederman" wrote: > > Oleg Nesterov writes: > > > Oleg Nesterov wrote: > >> > >> Eric W. Biederman wrote: > >> > > >> > - list_add_tail(&thread->tasks, &init_task.tasks); > >> > >> The last deletion is wrong, I beleive. > > > > Just to clarify, it looks like we can kill this line because > > de_thread() also does list_add_tail(current, &init_task.tasks). > > > > But please note that it (and probably __ptrace_link() above) > > does list_del(current->task) first, and current->task may have > > very stale values after old leader called dup_task_struct(). > > SET_LINKS() in copy_process() does nothing with ->tasks in a > > CLONE_THREAD case. > > Good point in that instance we need to remove the list_del > as well. We can't just remove this list_del, note __ptrace_link() above. So if we remove list_add from switch_exec_pids() (like you did in your patch) we should also place list_add before ptrace_link() in de_thread(), otherwise I beleive it is a bug. I agree, we should cleanup this. I just noticed that I forgot to add you on CC: list while sending this patch: http://marc.theaimsgroup.com/?l=linux-kernel&m=113862839924746 Btw, I don't understand why __ptrace_link() use REMOVE_LINKS/SET_LINKS instead of remove_parent/add_parent. Oleg. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/