Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp43562ybk; Tue, 19 May 2020 15:03:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz5B6cfNiLDfmiaXKsFYXbErfhSg6My0o3cbv72JwOLNOGLScsSIQ7Nr0StJKXHfb4Q7IpY X-Received: by 2002:a17:906:edbd:: with SMTP id sa29mr1271629ejb.128.1589925822958; Tue, 19 May 2020 15:03:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589925822; cv=none; d=google.com; s=arc-20160816; b=v8smEXUh2vytc50b+Xegsm1Lj9uK0WHSXugqSYIIhGI/WzZ6c1Xub+24kq27sqYVnp u8dUvP90gzVlz3XitUCRAWJombILZVWmP54fAiay2ZZDsCDQ6TToFgqIr8PnQ0az6Utm LiGf7jxDSUDFaUhOKRsmngPyIstNB3CaZ2lJMOcPkqPAekcv//gC1mnyFuulG5kuT5au OEOuD7tEsrj0cmdnqmoz9Z8lsmoZV/+xmxp3Vh8Lk+R7GNWBlMxc501tOX41OLeQGsKC 2Dw+7ZM1GEO6CQNHDQPPdRURULMrdYn7GA9c7fTP/45cUs5a4cwAsSC3Pnxj9TqXNVYE Iysg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=aJ30tY44Y1IVnHTs0oYR9AupzvvK3j296liG3N8OpVo=; b=jTULp07GWYU3wUOfqHfxHEuwVQCy14Y0R6p1ERqYKblGrs5yVES9asc6hW64iET1gg wEbFpR0soSrT1VkHCP7JJHuR+WP4CKGJqtX+HHggH4iSCBHYpvBYf/rfuLpNDajlDRmB lO7AD02pctvmgoJMUT4aGMmuuemznGox331fvllDamdZ+sXEGIBgY08DYX6+NbYdCxZq drLVA4v19eHtMMt0fwUpHwPV2O5Jdud1Enm9Qog4Ab+n8MT8nG0nIsLGesIYYbp8EV0A ku6dp3r9CQ9ld/6FwwW24BkYXfouXGOi8rnk705mtjssYnOCb5VMMZiT/EdE7f6xSvu9 XjHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@landley-net.20150623.gappssmtp.com header.s=20150623 header.b=ftiUb59L; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c59si416255edd.430.2020.05.19.15.03.19; Tue, 19 May 2020 15:03:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@landley-net.20150623.gappssmtp.com header.s=20150623 header.b=ftiUb59L; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727029AbgESV7H (ORCPT + 99 others); Tue, 19 May 2020 17:59:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726194AbgESV7G (ORCPT ); Tue, 19 May 2020 17:59:06 -0400 Received: from mail-ot1-x342.google.com (mail-ot1-x342.google.com [IPv6:2607:f8b0:4864:20::342]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A8068C08C5C1 for ; Tue, 19 May 2020 14:59:06 -0700 (PDT) Received: by mail-ot1-x342.google.com with SMTP id a68so835689otb.10 for ; Tue, 19 May 2020 14:59:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=landley-net.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=aJ30tY44Y1IVnHTs0oYR9AupzvvK3j296liG3N8OpVo=; b=ftiUb59LkFILedozGY9XVYdMy2l42E9hAhepGXbGxUyVa+wAu6aqRNDMJALil6/O8J booNhbKuCLrJsvfeGYjMVBbrzm+mRolULhd3N/LGe1R7ZdYQZzgHYrtpJe1Rq05peuT4 SQk27e6lcCUHwKixSX6yhM/JFqcggLFmwNd5gg8N9HHaBZCEayCGGf3J4Ks/Kpuj9Pej A3YhDP9GJDMu627RGDh+4viwdlrocpgf05zpzxRYjp5SXVWViTZ+1x5ji3fdzeawktay 3oKrus4lO58304pOZVtJGawndLbdhjykoMteObMV2UkVXKcxGi2g6rBzwPJLXHgcEHzI m1/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=aJ30tY44Y1IVnHTs0oYR9AupzvvK3j296liG3N8OpVo=; b=k+ao/hBSIIYeS9mdN/QyWI1XDqYaxm6gT4n4qJx8no2H5q0/glYbS8pLHRzcw0BibR ubAchzwkAVwlraRXJvS+kgUu/3sklWkhaUhlRNUdK3zPw8hBKqz8/nVEL5edcy5LtYVW w2wgcwo2oQFBjX7bBYh3pzhd7ZKpbyYgGyNBGgL6lz8Xaq5Mx6R3bZAwYu6mfB5DqYbz 3sBx9dT2u5JSZgvOnO+FTwhS+vD09gIq+H4dp/Ca3WDvPTVa45chURWTiswilfdD8qc/ i6bK/LXXyA23hEib/qMO5wg6PqaCbl4Muf9G9xmN+0Bm2UWzG0mTjgMOHXchgHAdxGkr hTyw== X-Gm-Message-State: AOAM532MlV9kc3RrhF5dVe2jWCpf1IjQ7/M1LH9rDsaB2hZDijWtVD7O 3FfI0NmMkPk1XPI9A6tLXACNrA== X-Received: by 2002:a9d:7657:: with SMTP id o23mr694391otl.255.1589925546087; Tue, 19 May 2020 14:59:06 -0700 (PDT) Received: from [192.168.86.21] ([136.62.4.88]) by smtp.gmail.com with ESMTPSA id k7sm235221otp.46.2020.05.19.14.59.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 19 May 2020 14:59:05 -0700 (PDT) Subject: Re: [PATCH v2 7/8] exec: Generic execfd support To: "Eric W. Biederman" , linux-kernel@vger.kernel.org Cc: Linus Torvalds , Oleg Nesterov , Jann Horn , Kees Cook , Greg Ungerer , Bernd Edlinger , linux-fsdevel@vger.kernel.org, Al Viro , Alexey Dobriyan , Andrew Morton , Casey Schaufler , linux-security-module@vger.kernel.org, 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> From: Rob Landley Message-ID: Date: Tue, 19 May 2020 16:59:06 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <87y2poyd91.fsf_-_@x220.int.ebiederm.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/18/20 7:33 PM, Eric W. Biederman wrote: > > Most of the support for passing the file descriptor of an executable > to an interpreter already lives in the generic code and in binfmt_elf. > Rework the fields in binfmt_elf that deal with executable file > descriptor passing to make executable file descriptor passing a first > class concept. I was reading this to try to figure out how to do execve(NULL, argv[], envp) to re-exec self after a vfork() in a chroot with no /proc, and hit the most trivial quibble ever: > --- a/fs/exec.c > +++ b/fs/exec.c > @@ -1323,7 +1323,10 @@ int begin_new_exec(struct linux_binprm * bprm) > */ > set_mm_exe_file(bprm->mm, bprm->file); > > + /* If the binary is not readable than enforce mm->dumpable=0 */ then Rob