From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f48.google.com ([74.125.82.48]:32995 "EHLO mail-wm0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933039AbcI3Sa0 (ORCPT ); Fri, 30 Sep 2016 14:30:26 -0400 Received: by mail-wm0-f48.google.com with SMTP id b4so6218740wmb.0 for ; Fri, 30 Sep 2016 11:30:25 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20160930134404.GA12862@redhat.com> References: <1474663238-22134-1-git-send-email-jann@thejh.net> <1474663238-22134-3-git-send-email-jann@thejh.net> <20160930132046.GA12047@redhat.com> <20160930134404.GA12862@redhat.com> From: Kees Cook Date: Fri, 30 Sep 2016 11:30:23 -0700 Message-ID: Subject: Re: [PATCH v2 2/8] exec: turn self_exec_id into self_privunit To: Oleg Nesterov Cc: Jann Horn , Alexander Viro , Roland McGrath , John Johansen , James Morris , "Serge E. Hallyn" , Paul Moore , Stephen Smalley , Eric Paris , Casey Schaufler , Andrew Morton , Janis Danisevskis , Seth Forshee , "Eric . Biederman" , Thomas Gleixner , Benjamin LaHaise , Ben Hutchings , Andy Lutomirski , Linus Torvalds , "linux-fsdevel@vger.kernel.org" , linux-security-module , "security@kernel.org" Content-Type: text/plain; charset=UTF-8 Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Fri, Sep 30, 2016 at 6:44 AM, Oleg Nesterov wrote: > forgot to mention... > > On 09/30, Oleg Nesterov wrote: >> >> On 09/23, Jann Horn wrote: >> > >> > One reason for doing this is that it prevents an attacker from sending an >> > arbitrary signal to a parent process after performing 2^32-1 execve() >> > calls. > > No, sets ->exit_signal = SIGCHLD. So the only problem is that the parent > can do clone(SIGKILL), then do execve() 2^32-1 times, then it can be killed > by SIGKILL from the exiting child. > > Honestly, I do not think this is security problem. It's a corner case, to be sure. But even sending a SIGKILL across privilege boundaries should not be allowed to happen. > >> I think we should simply kill self/parent_exec_id's. I am going to send >> the patch below after re-check/testing. > > Yes, I think this makes sense anyway. Hrm, I also thought this was used for more than just signal checking, but I don't see anything else right now. Maybe I was remembering earlier versions of Jann's patches... -Kees -- Kees Cook Nexus Security