From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 37E26C433E2 for ; Thu, 10 Sep 2020 17:23:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D7CFD2064B for ; Thu, 10 Sep 2020 17:23:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726841AbgIJRXR (ORCPT ); Thu, 10 Sep 2020 13:23:17 -0400 Received: from smtp-bc08.mail.infomaniak.ch ([45.157.188.8]:52119 "EHLO smtp-bc08.mail.infomaniak.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726399AbgIJRWK (ORCPT ); Thu, 10 Sep 2020 13:22:10 -0400 Received: from smtp-3-0000.mail.infomaniak.ch (unknown [10.4.36.107]) by smtp-3-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4BnQfr608ZzlhcF4; Thu, 10 Sep 2020 19:21:56 +0200 (CEST) Received: from ns3096276.ip-94-23-54.eu (unknown [94.23.54.103]) by smtp-3-0000.mail.infomaniak.ch (Postfix) with ESMTPA id 4BnQfp4Lxmzlh8T3; Thu, 10 Sep 2020 19:21:54 +0200 (CEST) Subject: Re: [RFC PATCH v9 0/3] Add introspect_access(2) (was O_MAYEXEC) 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> From: =?UTF-8?Q?Micka=c3=abl_Sala=c3=bcn?= Message-ID: Date: Thu, 10 Sep 2020 19:21:37 +0200 User-Agent: MIME-Version: 1.0 In-Reply-To: <20200910170424.GU6583@casper.infradead.org> Content-Type: text/plain; charset=iso-8859-15 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org 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