Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1685040ybz; Thu, 30 Apr 2020 03:47:38 -0700 (PDT) X-Google-Smtp-Source: APiQypLTDLI8ehhYWh7nzESU63A/g2G4tTpb6dSqc8qNM2PfKGFcmDaA8Q/HdoofAifhMqktGJ76 X-Received: by 2002:a05:6402:30ad:: with SMTP id df13mr1978385edb.339.1588243658650; Thu, 30 Apr 2020 03:47:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588243658; cv=none; d=google.com; s=arc-20160816; b=WTPw8v/ufyKXPFqb9UqzRYIJX7tE5wF/HtRIkar3o+Wj6QV2aIqrXAXZFhIqLSMj3i 3ozrkGP8hFGhPomhM3Ug6vRdYsRhx+TUk8e6CbQ4D6O3WEf2/oWT8yqwyzf/vcOL4QHa af/7FXflklkFaKNVOTNjUBYAiDf7aU79BhwR26sddfm+Qf+3nF9R9raHhifCFldNKHAv ZzT7n7evu38gDBgkkTDiWdjO2yQeNAAGLFacr6aQe3D9H1L/OudtzEw7hLj9wuF0JNH6 LJf6E05DEuWti0NgXJzbUT7wcQNY91GnAff47qFkEC0m3ucdVRUxRKmI5AA9+B1AVJ8m dApQ== 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; bh=hyUEAM8NCd9giDIkBndjVeYj3wFGkVdbz+EJjYz7wcY=; b=uFSstofkBUbvEZc2mAblB73ne7YVgqNt8Hr0oMRGp7liFrBjkBWtuGj8SVXoaYM1Le +E9FEXc0XBLff2Px7JnowYMp4ttmMijHvHFVDAUiLG7SKp2XmCJ+qqbs58icRCQsCUkB 0oZlqDi0ew0FLvP7H/dAuZJVdNxwMBTInvdKuUK+cqtXUGyBEpS05fmZ4p3N8czB/BeU xWWU/QfziEQXkqIrXAH5lsXcC2kGabE9fB/TWnelJAfmWNXYZfoofHtMnE/w4uE2+Kb0 2tX+PWg7JYWjLa0w85ALziA3UOhDvOEFhWAqXH6isLJ6mS6sJ8NtUu0brfpj8XLkKs+8 F3Tg== 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 g12si6069851ejw.314.2020.04.30.03.47.14; Thu, 30 Apr 2020 03:47:38 -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 S1726689AbgD3Kpp (ORCPT + 99 others); Thu, 30 Apr 2020 06:45:45 -0400 Received: from smtp-8fac.mail.infomaniak.ch ([83.166.143.172]:33263 "EHLO smtp-8fac.mail.infomaniak.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726309AbgD3Kpo (ORCPT ); Thu, 30 Apr 2020 06:45:44 -0400 Received: from smtp-2-0001.mail.infomaniak.ch (unknown [10.5.36.108]) by smtp-3-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 49CX912QbTzlhqlb; Thu, 30 Apr 2020 12:45:41 +0200 (CEST) Received: from ns3096276.ip-94-23-54.eu (unknown [94.23.54.103]) by smtp-2-0001.mail.infomaniak.ch (Postfix) with ESMTPA id 49CX8y5zpZzll5m6; Thu, 30 Apr 2020 12:45:38 +0200 (CEST) Subject: Re: [PATCH v3 0/5] Add support for RESOLVE_MAYEXEC To: Christian Brauner , Aleksa Sarai 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 , =?UTF-8?Q?Philippe_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 References: <20200428175129.634352-1-mic@digikod.net> <20200430015429.wuob7m5ofdewubui@yavin.dot.cyphar.com> <20200430080746.n26fja2444w6i2db@wittgenstein> From: =?UTF-8?Q?Micka=c3=abl_Sala=c3=bcn?= Message-ID: Date: Thu, 30 Apr 2020 12:45:38 +0200 User-Agent: MIME-Version: 1.0 In-Reply-To: <20200430080746.n26fja2444w6i2db@wittgenstein> Content-Type: text/plain; charset=utf-8 Content-Language: fr Content-Transfer-Encoding: 8bit X-Antivirus: Dr.Web (R) for Unix mail servers drweb plugin ver.6.0.2.8 X-Antivirus-Code: 0x100000 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 30/04/2020 10:07, Christian Brauner wrote: > 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. OK, I'll switch back to O_MAYEXEC.