Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751867Ab2KHMgm (ORCPT ); Thu, 8 Nov 2012 07:36:42 -0500 Received: from mx1.redhat.com ([209.132.183.28]:2027 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751118Ab2KHMgl (ORCPT ); Thu, 8 Nov 2012 07:36:41 -0500 Date: Thu, 8 Nov 2012 13:37:16 +0100 From: Oleg Nesterov To: Amnon Shiloh Cc: Denys Vlasenko , Michael Kerrisk , Serge Hallyn , Chris Evans , David Howells , "Eric W. Biederman" , Andrew Morton , u3557@dialix.com.au, security@kernel.org, linux-kernel@vger.kernel.org Subject: Re: PT_EXITKILL (Was: pdeath_signal) Message-ID: <20121108123716.GA20917@redhat.com> References: <20121107150934.GA27606@redhat.com> <20121108062935.BFF3A592024@miso.sublimeip.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20121108062935.BFF3A592024@miso.sublimeip.com> User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1110 Lines: 34 Hi Amnon, On 11/08, Amnon Shiloh wrote: > > Thanks for the patch, I tried it and it works nicely! OK, thanks. I'll wait for other comments a bit and then send the patch to Andrew. > Also, I just noticed that this new option (PTRACE_O_EXITKILL) is not > safe with ptrace(PTRACE_TRACEME)+execve, because the parent may die > before even having a chance to set PTRACE_O_EXITKILL! Not safe? I guess you meant that PTRACE_O_EXITKILL can't prevent this race? Yes sure. Or the parent can die before it does PTRACE_O_EXITKILL. > However, that's easy to fix by using PTRACE_ATTACH instead. Or the child can check getppid() == saved_parent_pid after PTRACE_TRACEME. But if you switch to PTRACE_ATTACH, I'd suggest to use PTRACE_SEIZE. Note that, in particular, this allows you to specify the options at attach. As for PF_NO_SIGSTOP, I'll write another email. 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/