Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp932841pxk; Thu, 10 Sep 2020 02:29:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyeUooekXLE63i8HbPMS75yxfq7M9BVLyIsmNI2vooE7rJG9MCP95reyp4yielmDI51PJxd X-Received: by 2002:a17:906:4750:: with SMTP id j16mr8299923ejs.143.1599730152737; Thu, 10 Sep 2020 02:29:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599730152; cv=none; d=google.com; s=arc-20160816; b=ou3/VOVAk3Q18bvLeTNuQ8BRJP1oDTkKBnZZXE08byYR1uOW9MVzf6imjRuZOwF4y4 HpuW2uRqay6VbZrcOc940MYRoppSXFgIGRKNF1IFhvEqWdyT8JEEGu1cbhgLZecSgIty qr7ygl+IdgY0MLuqjF/BwIbkYl7Oht7dWj2aA+emqWoT4fjNOOK9yUs2+m+869HiKBpT r/MwKFGJIuY8PZ4aO0UOPRs5djKTUojrkPJbJ9uVyaFXZDfynbjqqLOydG36nkY/58EM viu0s56Zx+FrmwZs9QWAKGWTJhEI1g026oURbA/BbDB0D8Aqra6kgfMIxklHbYjeJy84 ussA== 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=0iXMhhY2dFIMPRj7falS59siA+sy5oPZFGXvxXhjpZc=; b=odu0OYk1MFAj9fBkuAtYtgm7WchCcrIz8MbDO3ptWP8OdRzFxXXEbX/rpNavvL94Uz 2T3Mzoi7R2gx7TPaRH1QpfUlrSCJpoJw5gtjqVCmiu9gZ97vds/ckALxBG/izqPVLIf0 nyZ/P4BSyEGjKAPwdHKK3fAY3IBWzoCZ9Ok04S9PXs+j0zj/Pup7JfsQmJFT00YN4id/ K393IiGIBjkaPp0N2OPFMazL+scV/s3mKoVpazvD8LNEPUidXb7TXpRsA38hd1foQcYn 6f5D8UwjFjanTflpkrCHosEFc7OnfJFwmAXlx5pbXJJPJSmqewUifgTmlUlCXAGk7zaj e4bQ== 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 ck3si3155218ejb.362.2020.09.10.02.28.49; Thu, 10 Sep 2020 02:29:12 -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 S1730248AbgIJJ1n (ORCPT + 99 others); Thu, 10 Sep 2020 05:27:43 -0400 Received: from relay11.mail.gandi.net ([217.70.178.231]:39571 "EHLO relay11.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730400AbgIJJ1e (ORCPT ); Thu, 10 Sep 2020 05:27:34 -0400 Received: from gandi.net (laubervilliers-658-1-215-187.w90-63.abo.wanadoo.fr [90.63.246.187]) (Authenticated sender: thibaut.sautereau@clip-os.org) by relay11.mail.gandi.net (Postfix) with ESMTPSA id 14A87100013; Thu, 10 Sep 2020 09:26:54 +0000 (UTC) Date: Thu, 10 Sep 2020 11:26:56 +0200 From: Thibaut Sautereau To: Matthew Wilcox , Al Viro Cc: =?utf-8?Q?Micka=C3=ABl_Sala=C3=BCn?= , linux-kernel@vger.kernel.org, Aleksa Sarai , Alexei Starovoitov , Andrew Morton , Andy Lutomirski , Christian Brauner , Christian Heimes , Daniel Borkmann , Deven Bowers , Dmitry Vyukov , Eric Biggers , Eric Chiang , Florian Weimer , James Morris , Jan Kara , Jann Horn , Jonathan Corbet , Kees Cook , Lakshmi Ramasubramanian , Matthew Garrett , Michael Kerrisk , Miklos Szeredi , Mimi Zohar , Philippe =?utf-8?Q?Tr=C3=A9buchet?= , Scott Shell , Sean Christopherson , Shuah Khan , Steve Dower , Steve Grubb , Tetsuo Handa , Vincent Strubel , kernel-hardening@lists.openwall.com, linux-api@vger.kernel.org, linux-integrity@vger.kernel.org, linux-security-module@vger.kernel.org, linux-fsdevel@vger.kernel.org, Arnd Bergmann Subject: Re: [RFC PATCH v8 0/3] Add support for AT_INTERPRETED (was O_MAYEXEC) Message-ID: <20200910092656.GA800@gandi.net> References: <20200908075956.1069018-1-mic@digikod.net> <20200908185026.GU1236603@ZenIV.linux.org.uk> <20200909170851.GL6583@casper.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200909170851.GL6583@casper.infradead.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 09, 2020 at 06:08:51PM +0100, Matthew Wilcox wrote: > On Wed, Sep 09, 2020 at 09:19:11AM +0200, Mickaël Salaün wrote: > > > > On 08/09/2020 20:50, Al Viro wrote: > > > On Tue, Sep 08, 2020 at 09:59:53AM +0200, Mickaël Salaün wrote: > > >> Hi, > > >> > > >> This height patch series rework the previous O_MAYEXEC series by not > > >> adding a new flag to openat2(2) but to faccessat2(2) instead. As > > >> suggested, this enables to perform the access check on a file descriptor > > >> instead of on a file path (while opening it). This may require two > > >> checks (one on open and then with faccessat2) but it is a more generic > > >> approach [8]. > > > > > > Again, why is that folded into lookup/open/whatnot, rather than being > > > an operation applied to a file (e.g. O_PATH one)? > > > > I don't understand your question. AT_INTERPRETED can and should be used > > with AT_EMPTY_PATH. The two checks I wrote about was for IMA. > > Al is saying you should add a new syscall, not try to fold it into > some existing syscall. > > I agree with him. Add a new syscall, just like you were told to do it > last time. Sure, we'll do it. In the meantime, could we at least get an explanation about why using faccessat2() instead of a new syscall is wrong? I could see the reasons for separating the exec checks from the file opening, but this time I don't understand. Is it because it brings too much complexity to do_faccessat()? -- Thibaut Sautereau CLIP OS developer