Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1554820ybz; Thu, 30 Apr 2020 01:12:50 -0700 (PDT) X-Google-Smtp-Source: APiQypLN3ZMvBxrYVv0XV5WT8WXpR7o4lAYqeF9mELMikNYcNW4PWy07FjUMFt1LvKPG/SDH7lv2 X-Received: by 2002:a17:906:3291:: with SMTP id 17mr1522605ejw.343.1588234370499; Thu, 30 Apr 2020 01:12:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588234370; cv=none; d=google.com; s=arc-20160816; b=t41ChzexkZZUTVM8Tcl6ypmrw5JPOepTPBbczGauO54BBvSw0EE3wVLdlqj9x+Cf/W fVUqcphDSIBz2IYXxDup8MZeXMZ7q57QIX+MvwPKc4hBr7ML+TmcKhnulZFvpDbRHHIX wjZcLaL5m7YjnRm9rIor5tBRC38/R+zBchwHSHp5kG24sieTITG6ePdRaQyCVDtkL/um e1Rc9mSH/zzEOf4lwLTaofGwIiPxRa7d18K19WelTG27LlOq9I1S2U9t8eUUu3IUtsxr Ty46ctue20wfh/x2VuhdN2JJBYhIa1xeNSprNEHZFnnEXD77NfNCQo55t/5VeY/K9UH9 vFeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=gh8EqWWeXArnwC7zLplhHslCh3Wqu3nhRgy9h8vWGp8=; b=Y+6cyePqhhONf64XAJZHKe5XjzSY9HORlw5GBWDVmtEHWe6piZ3wbOxXTaVAj9XHq/ D/6nFb42An/oFnYmq3JOn2onJPfE5LUzlVG9/4Y+xP6TtvTx3i8V8KKTDHcqJDW/ZJlD q2jltzn8edgj+M/xC5LjDiLeLYvAxWtq421ymLW7sUViNf+fHDmjGo6G2/d6uKxRG1Mj GSzXR+P17jZIqx++0JdqberAJ6VyaaXAIFH3x6d2h1rgET/aoQYthBwGRLnFnJmzM771 9E4De+YLlZ3job/cFav+LP/P/p8N39p3c9qtM0hldX3RP6+t+bEt2L9CGv1qJbgdaHU9 1yLQ== ARC-Authentication-Results: i=1; mx.google.com; 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 a3si4860067edv.206.2020.04.30.01.12.27; Thu, 30 Apr 2020 01:12:50 -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; 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 S1727784AbgD3IHz (ORCPT + 99 others); Thu, 30 Apr 2020 04:07:55 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:37501 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726453AbgD3IHz (ORCPT ); Thu, 30 Apr 2020 04:07:55 -0400 Received: from ip5f5af183.dynamic.kabel-deutschland.de ([95.90.241.131] helo=wittgenstein) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1jU4EW-0000NO-1I; Thu, 30 Apr 2020 08:07:48 +0000 Date: Thu, 30 Apr 2020 10:07:46 +0200 From: Christian Brauner To: Aleksa Sarai Cc: =?utf-8?Q?Micka=C3=ABl_Sala=C3=BCn?= , linux-kernel@vger.kernel.org, Alexei Starovoitov , Al Viro , Andy Lutomirski , Christian Heimes , Daniel Borkmann , Deven Bowers , Eric Chiang , Florian Weimer , James Morris , Jan Kara , Jann Horn , Jonathan Corbet , Kees Cook , Matthew Garrett , Matthew Wilcox , Michael Kerrisk , =?utf-8?Q?Micka=C3=ABl_Sala=C3=BCn?= , Mimi Zohar , Philippe =?utf-8?Q?Tr=C3=A9buchet?= , Scott Shell , Sean Christopherson , Shuah Khan , Steve Dower , Steve Grubb , Thibaut Sautereau , Vincent Strubel , kernel-hardening@lists.openwall.com, linux-api@vger.kernel.org, linux-security-module@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH v3 0/5] Add support for RESOLVE_MAYEXEC Message-ID: <20200430080746.n26fja2444w6i2db@wittgenstein> References: <20200428175129.634352-1-mic@digikod.net> <20200430015429.wuob7m5ofdewubui@yavin.dot.cyphar.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200430015429.wuob7m5ofdewubui@yavin.dot.cyphar.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 30, 2020 at 11:54:29AM +1000, Aleksa Sarai wrote: > On 2020-04-28, Mickaël Salaün wrote: > > The goal of this patch series is to enable to control script execution > > with interpreters help. A new RESOLVE_MAYEXEC flag, usable through > > openat2(2), is added to enable userspace script interpreter to delegate > > to the kernel (and thus the system security policy) the permission to > > interpret/execute scripts or other files containing what can be seen as > > commands. > > > > This third patch series mainly differ from the previous one by relying > > on the new openat2(2) system call to get rid of the undefined behavior > > of the open(2) flags. Thus, the previous O_MAYEXEC flag is now replaced > > with the new RESOLVE_MAYEXEC flag and benefits from the openat2(2) > > strict check of this kind of flags. > > My only strong upfront objection is with this being a RESOLVE_ flag. > > RESOLVE_ flags have a specific meaning (they generally apply to all > components, and affect the rules of path resolution). RESOLVE_MAYEXEC > does neither of these things and so seems out of place among the other > RESOLVE_ flags. > > I would argue this should be an O_ flag, but not supported for the I agree. Christian