From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C1461C433DF for ; Tue, 19 May 2020 20:24:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A8623206C3 for ; Tue, 19 May 2020 20:24:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726999AbgESUYO (ORCPT ); Tue, 19 May 2020 16:24:14 -0400 Received: from out02.mta.xmission.com ([166.70.13.232]:54046 "EHLO out02.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726283AbgESUYO (ORCPT ); Tue, 19 May 2020 16:24:14 -0400 Received: from in01.mta.xmission.com ([166.70.13.51]) by out02.mta.xmission.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jb8mX-0002h2-BJ; Tue, 19 May 2020 14:24:09 -0600 Received: from ip68-227-160-95.om.om.cox.net ([68.227.160.95] helo=x220.xmission.com) by in01.mta.xmission.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.87) (envelope-from ) id 1jb8mW-0002mR-Ik; Tue, 19 May 2020 14:24:09 -0600 From: ebiederm@xmission.com (Eric W. Biederman) To: Linus Torvalds Cc: Kees Cook , Linux Kernel Mailing List , Oleg Nesterov , Jann Horn , Greg Ungerer , Rob Landley , Bernd Edlinger , linux-fsdevel , Al Viro , Alexey Dobriyan , Andrew Morton , Casey Schaufler , LSM List , James Morris , "Serge E. Hallyn" , Andy Lutomirski References: <87h7wujhmz.fsf@x220.int.ebiederm.org> <87sgga6ze4.fsf@x220.int.ebiederm.org> <87v9l4zyla.fsf_-_@x220.int.ebiederm.org> <877dx822er.fsf_-_@x220.int.ebiederm.org> <87y2poyd91.fsf_-_@x220.int.ebiederm.org> <202005191220.2DB7B7C7@keescook> Date: Tue, 19 May 2020 15:20:27 -0500 In-Reply-To: (Linus Torvalds's message of "Tue, 19 May 2020 12:54:40 -0700") Message-ID: <87a723n0c4.fsf@x220.int.ebiederm.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-XM-SPF: eid=1jb8mW-0002mR-Ik;;;mid=<87a723n0c4.fsf@x220.int.ebiederm.org>;;;hst=in01.mta.xmission.com;;;ip=68.227.160.95;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX19Go4GcdBQ9Hlcsq7Wxbs0FCcH2FRifgGQ= X-SA-Exim-Connect-IP: 68.227.160.95 X-SA-Exim-Mail-From: ebiederm@xmission.com Subject: Re: [PATCH v2 7/8] exec: Generic execfd support X-SA-Exim-Version: 4.2.1 (built Thu, 05 May 2016 13:38:54 -0600) X-SA-Exim-Scanned: Yes (on in01.mta.xmission.com) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Linus Torvalds writes: > On Tue, May 19, 2020 at 12:46 PM Kees Cook wrote: >> >> Though frankly, I wonder if interp_flags could just be removed in favor >> of two new bit members, especially since interp_data is gone: > > Yeah, I think that might be a good cleanup - but please keep it as a > separate thing at the end of the series (or maybe the beginning) I will. With a little care we can replace setting BINPRM_FLAGS_ENFORCE_NONDUMP and clearing bprm->mm->dumpable. Which is the direction I have been looking. Now that I think about it I believe that the loop in exec_binprm should be clearing BINPRM_FLAGS_PATH_INACCESSIBLE as it is only relevant to fexec/execveat with a close on exec file descriptor. Eric