From mboxrd@z Thu Jan 1 00:00:00 1970 From: Oleg Nesterov Subject: self_exec_id/parent_exec_id && CLONE_PARENT Date: Sun, 11 Mar 2012 18:49:53 +0100 Message-ID: <20120311174953.GB2729@redhat.com> References: <1331421919-15499-1-git-send-email-tixxdz@opendz.org> <1331421919-15499-2-git-send-email-tixxdz@opendz.org> <20120311172512.GA2729@redhat.com> Reply-To: kernel-hardening@lists.openwall.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-kernel@vger.kernel.org, kernel-hardening@lists.openwall.com, Andrew Morton , Al Viro , Alexey Dobriyan , "Eric W. Biederman" , Vasiliy Kulikov , Kees Cook , Solar Designer , WANG Cong , James Morris , linux-security-module@vger.kernel.org, linux-fsdevel@vger.kernel.org, Greg KH , Ingo Molnar , Stephen Wilson , "Jason A. Donenfeld" To: Djalal Harouni , Linus Torvalds , Alan Cox Return-path: List-Post: List-Help: List-Unsubscribe: List-Subscribe: Content-Disposition: inline In-Reply-To: <20120311172512.GA2729@redhat.com> List-Id: linux-fsdevel.vger.kernel.org (change subject) On 03/11, Oleg Nesterov wrote: > > Well, I don't think it is right to add this counter into task_struct. > > It should be per-process, signal_struct makes more sense. Or may be > mm_struct. > > Btw this is also true for parent_exec_id/self_exec_id, but this is > another story. In fact I think it would be nice to kill parent_exec_id/self_exec_id. Afaics, this only problem is clone(CLONE_PARENT | SIGXXX). I expect the answer is "no, can break existing applications", but I'll ask anyway. Can't we change this? IOW, can't we modify copy_process - p->exit_signal = (clone_flags & CLONE_THREAD) ? -1 : (clone_flags & CSIGNAL); + p->exit_signal = + (clone_flags & CLONE_THREAD) ? -1 : + (clobe_flags & CLONE_PARENT) ? current->group_leader->exit_signal : + (clone_flags & CSIGNAL); (or simply use SIGCHLD instead of group_leader->exit_signal). Then we can kill parent_exec_id/self_exec_id if me modify de_thread() to set ->exit_signal = SIGCHLD for every child. I am also asking because the change above looks like the fix to me. The child must not control its ->exit_signal, it is the parent who decides which signal the child should use for notification. And to me, clone(CLONE_PARENT | SIGXXX) looks like a violation of rule above. Oleg.