Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1258480pxk; Thu, 10 Sep 2020 10:50:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxiBRgjMYsdsPFtuyAttInb3DoRPRxZm/3GCV9gAV8H9hiTukbShdYaDUFR6+oSWiK4CezF X-Received: by 2002:a17:906:f950:: with SMTP id ld16mr9828482ejb.489.1599760210198; Thu, 10 Sep 2020 10:50:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599760210; cv=none; d=google.com; s=arc-20160816; b=X6NkL6OHuBF/9rMD2cUZLjAASGLbD/1oDinEqHWh2wWqatRH3vuWwfNGmCDudoTe/J mxkXYnSWkWdXFD/ci+cJSCsVXYZ8hPoprfb7AY/WdvwVk8Aj1K9CEiBot3lLueDFxbMa aNxZHidpsjr7q42iMLmVF6I6NbmQbWyW+mTk20vCoqRk5OMCjCb9ZnwbhtGEHrG2WDIx 9sNBm1kq2WE5w6/6z2RtKrZveAl0bfDjvwjtLduFl42qpwVW+qAXUUklNSc2qQul1W0L 2NAoy9LNAu8O1YyDwwFTO82oaH2xlb7FhoY+NJURJjFI/yt/yEaOZpbq93rs+r8u+VLW lTGg== 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:references:cc:to:from:subject; bh=AoOkLVo3bhmD/SzYERfnhBXa3ZH9vLwBgFnGBQDWAus=; b=kzg7lco8AjVLPGmecpjQFEmnDfctMnLvgtni/CFVSiEh0k8YiWGSyOKWN1j4MzIXia 7mxhk/7mp9rGOHBIVyhCPqOC5PoCiHbH+YjtxcxkAI2RhgslTqWxEwASdhvXblMxWpry hnCvW9HV9gWO+OSMcv0uG9SsyyNti77EVAU/hxGVPWPFAY4e2djHdbZ4BmowSClV+OBL jJyCMHkIQ5y0mmOh8kA5G6yqBCHHBJOZNb9wyxvsjQUuTgAuLxvPw33mn+O47d71JOQE uKNcxHN9NGNpjILnlxBaNY1//OL8MT4AuA/Xg4ftMYyrr9B3t4Pq0pgCcjNEExZX7lvr kPXg== 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 l10si4042167edr.220.2020.09.10.10.49.46; Thu, 10 Sep 2020 10:50: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 S1725965AbgIJRsf (ORCPT + 99 others); Thu, 10 Sep 2020 13:48:35 -0400 Received: from smtp-42ab.mail.infomaniak.ch ([84.16.66.171]:40135 "EHLO smtp-42ab.mail.infomaniak.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726443AbgIJRrb (ORCPT ); Thu, 10 Sep 2020 13:47:31 -0400 Received: from smtp-2-0000.mail.infomaniak.ch (unknown [10.5.36.107]) by smtp-2-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4BnRD01cD0zlhbLN; Thu, 10 Sep 2020 19:47:12 +0200 (CEST) Received: from ns3096276.ip-94-23-54.eu (unknown [94.23.54.103]) by smtp-2-0000.mail.infomaniak.ch (Postfix) with ESMTPA id 4BnRCx4s7fzlh8TC; Thu, 10 Sep 2020 19:47:09 +0200 (CEST) Subject: Re: [RFC PATCH v9 0/3] Add introspect_access(2) (was O_MAYEXEC) From: =?UTF-8?Q?Micka=c3=abl_Sala=c3=bcn?= To: Matthew Wilcox Cc: linux-kernel@vger.kernel.org, Aleksa Sarai , Alexei Starovoitov , Al Viro , Andrew Morton , Andy Lutomirski , Arnd Bergmann , Casey Schaufler , 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 , =?UTF-8?Q?Philippe_Tr=c3=a9buchet?= , Scott Shell , Sean Christopherson , Shuah Khan , Steve Dower , Steve Grubb , Tetsuo Handa , Thibaut Sautereau , 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 References: <20200910164612.114215-1-mic@digikod.net> <20200910170424.GU6583@casper.infradead.org> Message-ID: <18ff83c0-d128-76bc-1081-82e3a3c51616@digikod.net> Date: Thu, 10 Sep 2020 19:47:09 +0200 User-Agent: MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=iso-8859-15 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/09/2020 19:21, Micka?l Sala?n wrote: > > On 10/09/2020 19:04, Matthew Wilcox wrote: >> On Thu, Sep 10, 2020 at 06:46:09PM +0200, Micka?l Sala?n wrote: >>> This ninth patch series rework the previous AT_INTERPRETED and O_MAYEXEC >>> series with a new syscall: introspect_access(2) . Access check are now >>> only possible on a file descriptor, which enable to avoid possible race >>> conditions in user space. >> >> But introspection is about examining _yourself_. This isn't about >> doing that. It's about doing ... something ... to a script that you're >> going to execute. If the script were going to call the syscall, then >> it might be introspection. Or if the interpreter were measuring itself, >> that would be introspection. But neither of those would be useful things >> to do, because an attacker could simply avoid doing them. > > Picking a good name other than "access" (or faccessat2) is not easy. The > idea with introspect_access() is for the calling task to ask the kernel > if this task should allows to do give access to a kernel resource which > is already available to this task. In this sense, we think that > introspection makes sense because it is the choice of the task to allow > or deny an access. > >> >> So, bad name. What might be better? sys_security_check()? >> sys_measure()? sys_verify_fd()? I don't know. >> > > "security_check" looks quite broad, "measure" doesn't make sense here, > "verify_fd" doesn't reflect that it is an access check. Yes, not easy, > but if this is the only concern we are on the good track. :) > > > Other ideas: > - interpret_access (mainly, but not only, for interpreters) > - indirect_access > - may_access > - faccessat3 > I think that entrusted_access(2) looks good. What do you think?