Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1287214ybz; Wed, 29 Apr 2020 18:57:11 -0700 (PDT) X-Google-Smtp-Source: APiQypJXPjlhCHL2C6UrfvluPtoKPsTJaDCOyABwgsWdDq4vKfB05kHqlSda72nAUEt7dsin8Mbp X-Received: by 2002:aa7:d7c1:: with SMTP id e1mr773920eds.8.1588211830960; Wed, 29 Apr 2020 18:57:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588211830; cv=none; d=google.com; s=arc-20160816; b=uAdsQDVfvVdbDr0GJMQkZ9ds3QnmnCLR3uOlxX8AQDVd+6a52e2IkeKN2r2crGk87y QzbeO40x9I8Z85E1wFPNG0wSf753uDETgydc1CdrlZH9smdIr8Dvxzqvv4j5ZzXyy6p3 jKE/MJrMHAhFVRrfehK0L+uxraO0llRQOCxGoU1EBz+ywMMOW2NArKOF3u3WeTKDrmFr nFYfVDbNrZDU2Wbftb0zLIxvrlsA6OtfZaBuZBSSnzlvO+cPyfh7n9RqS6mBiHOwct9G /aL1jEhnjSK1mu1hUBW5FlS39s4q5phIwWMBRCiia1CjgX3pTOwwZZ8p5NvsiOJbVlvE lpnw== 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-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=6QS8TJ1ZmTQQs5UudoWvOLgtRoXPNBcZSf+2X+5vHs4=; b=z+IPctz0ncYpzjMosRC9JZM0L3HlVJRbmk2gJ8EsxvM0fLmdLbGf7VDsJHpTD4cFJ4 RO4V3vzvF81InV2uzeZoDNra0f0056sonMOXL/Cxvv+UaOmr+D0LeidmGzNsNBFTWerb jANcbhMKmf6OgRj4J8zw3guf6fWc1+3PlDfwBNBOrn1KRqkWk745kF7lOEc38exhKHdW OqIGnmaD8KlgoF3dMy0F51UhizTcm0vm5zDJD4J/XnMtiDmrhEnDIpmd8ZM8LeHtX1F6 ZRgTV7KY5UmoDWokIa9IA0ejxor+Dz9eAoufvb4uYItX4XMuQzqXBbsBykPzapMAVKgQ /TsQ== 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 d4si1934104edp.87.2020.04.29.18.56.47; Wed, 29 Apr 2020 18:57:10 -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 S1726814AbgD3By7 (ORCPT + 99 others); Wed, 29 Apr 2020 21:54:59 -0400 Received: from mout-p-103.mailbox.org ([80.241.56.161]:64626 "EHLO mout-p-103.mailbox.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726180AbgD3By6 (ORCPT ); Wed, 29 Apr 2020 21:54:58 -0400 Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:105:465:1:2:0]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mout-p-103.mailbox.org (Postfix) with ESMTPS id 49CJNb3n0DzKmWf; Thu, 30 Apr 2020 03:54:55 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp2.mailbox.org ([80.241.60.241]) by spamfilter03.heinlein-hosting.de (spamfilter03.heinlein-hosting.de [80.241.56.117]) (amavisd-new, port 10030) with ESMTP id QqYb_XfmfTzI; Thu, 30 Apr 2020 03:54:50 +0200 (CEST) Date: Thu, 30 Apr 2020 11:54:29 +1000 From: Aleksa Sarai To: =?utf-8?Q?Micka=C3=ABl_Sala=C3=BCn?= Cc: 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: <20200430015429.wuob7m5ofdewubui@yavin.dot.cyphar.com> References: <20200428175129.634352-1-mic@digikod.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="udruashf3djnhxyp" Content-Disposition: inline In-Reply-To: <20200428175129.634352-1-mic@digikod.net> X-Rspamd-Queue-Id: 185431774 X-Rspamd-Score: -5.53 / 15.00 / 15.00 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --udruashf3djnhxyp Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2020-04-28, Micka=EBl Sala=FCn 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. >=20 > 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 old-style open(2). This is what the O_SPECIFIC_FD patchset does[1] and I think it's a reasonable way of solving such problems. --=20 Aleksa Sarai Senior Software Engineer (Containers) SUSE Linux GmbH --udruashf3djnhxyp Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQSxZm6dtfE8gxLLfYqdlLljIbnQEgUCXqov0QAKCRCdlLljIbnQ Es1XAP4pdpkX/auZ9BMKqDz4Q71lNx9hZ2pPWO2GKtz3HxWg3QD/d346yEY1nSmz 4QrB06Se4f0JFMG5Fy1QoGIpSoBx+Qk= =DOB3 -----END PGP SIGNATURE----- --udruashf3djnhxyp--