Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1400187pxb; Mon, 11 Oct 2021 05:20:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxCIWMdkiMCcyICob9G+EbzSYxMiVK4QowqzrOxk5Rwa/9Po/YjWFyeOTid8TLi8zJOUy5E X-Received: by 2002:a05:6402:90c:: with SMTP id g12mr1726916edz.198.1633954847024; Mon, 11 Oct 2021 05:20:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633954847; cv=none; d=google.com; s=arc-20160816; b=AyWKYIgztnXGQ1EhCCKVahhqnmSFUDRkUFYiLI7M+6v0C+RM27dLiVQRGOOTA7wK93 b8cDMgpt3hS3LJZO6oMtv5FgqAt841MNtlla/+ikSEjgmE2rcz0AxwA0vd5KcBr5eVi7 s49dguTiKCdeNnexWUW2suryps5GLtgLFGjIrzDfH3MhshC0pyuO0WdZoPZ/sgz3TQVl x44nFmQsYfL8T62m/0bq9p1q8JbWHeYo1yVHwlb2V0wtREo584wbFu0hDBU6swugVL4b 9h9avAIl0AoH+rC8pq7zvBvFzzj3CpvkxFB8du4vmFjDlOotUi1AEGPIHuq9RmjkBIxU KCuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=bI4dbud3unzJsLZEGCNsvXjIfS8pidA5Sg3zME5i0rc=; b=uBB58hjKe52HT5jlFAACPmXpqqwpuwaB/inBUOfZL2q2tlyOIGJFKMi6m1y4I2tj/0 aBjprurDS8chtrb4Tw/PkNCl0Kc4XTLygMJI41s2IxvQfCJBiZZsURsOX5gSUc4zaKS5 t4CVUqZIZPCOHN5GI/p7xVb8SW/aBoSeGhIkWm/qQQP8DZgbtSbOpGN6OwrJ2WTWUy5R 6s7Mmv8VLA1aEFf2VDH71ljXWkzh8ajfclpHugrmjFhMvc/RxLXcoTU7AxvAZkzyO8oy K6XFNasMh09e1Hgpjw4/j9oSblVyjv5PpPGtAG/FppoEtLH2EH0lbbZIuWnmSNRuPyyZ KuUg== 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 n2si12236058edi.385.2021.10.11.05.19.58; Mon, 11 Oct 2021 05:20:47 -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 S235296AbhJKIsS (ORCPT + 99 others); Mon, 11 Oct 2021 04:48:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49640 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235327AbhJKIsQ (ORCPT ); Mon, 11 Oct 2021 04:48:16 -0400 Received: from smtp-42aa.mail.infomaniak.ch (smtp-42aa.mail.infomaniak.ch [IPv6:2001:1600:4:17::42aa]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E9CBEC061570 for ; Mon, 11 Oct 2021 01:46:16 -0700 (PDT) Received: from smtp-3-0001.mail.infomaniak.ch (unknown [10.4.36.108]) by smtp-3-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4HSXT32QDgzMq0TS; Mon, 11 Oct 2021 10:46:15 +0200 (CEST) Received: from ns3096276.ip-94-23-54.eu (unknown [23.97.221.149]) by smtp-3-0001.mail.infomaniak.ch (Postfix) with ESMTPA id 4HSXT10Jtzzlh8TC; Mon, 11 Oct 2021 10:46:13 +0200 (CEST) Subject: Re: [PATCH v14 0/3] Add trusted_for(2) (was O_MAYEXEC) To: Andrew Morton Cc: Al Viro , Aleksa Sarai , Andy Lutomirski , Arnd Bergmann , Casey Schaufler , Christian Brauner , Christian Heimes , Deven Bowers , Dmitry Vyukov , Eric Biggers , Eric Chiang , Florian Weimer , Geert Uytterhoeven , James Morris , Jan Kara , Jann Horn , Jonathan Corbet , Kees Cook , Lakshmi Ramasubramanian , "Madhavan T . Venkataraman" , Matthew Garrett , Matthew Wilcox , Miklos Szeredi , Mimi Zohar , Paul Moore , =?UTF-8?Q?Philippe_Tr=c3=a9buchet?= , Scott Shell , Shuah Khan , Steve Dower , Steve Grubb , Thibaut Sautereau , Vincent Strubel , kernel-hardening@lists.openwall.com, linux-api@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org References: <20211008104840.1733385-1-mic@digikod.net> <20211010144814.d9fb99de6b0af65b67dc96cb@linux-foundation.org> From: =?UTF-8?Q?Micka=c3=abl_Sala=c3=bcn?= Message-ID: <457941da-c4a4-262f-2981-74a85519c56f@digikod.net> Date: Mon, 11 Oct 2021 10:47:04 +0200 User-Agent: MIME-Version: 1.0 In-Reply-To: <20211010144814.d9fb99de6b0af65b67dc96cb@linux-foundation.org> Content-Type: text/plain; charset=UTF-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/10/2021 23:48, Andrew Morton wrote: > On Fri, 8 Oct 2021 12:48:37 +0200 Mickaël Salaün wrote: > >> The final goal of this patch series is to enable the kernel to be a >> global policy manager by entrusting processes with access control at >> their level. To reach this goal, two complementary parts are required: >> * user space needs to be able to know if it can trust some file >> descriptor content for a specific usage; >> * and the kernel needs to make available some part of the policy >> configured by the system administrator. > > Apologies if I missed this... > > It would be nice to see a description of the proposed syscall interface > in these changelogs! Then a few questions I have will be answered... I described this syscall and it's semantic in the first patch in Documentation/admin-guide/sysctl/fs.rst Do you want me to copy-paste this content in the cover letter? > > long trusted_for(const int fd, > const enum trusted_for_usage usage, > const u32 flags) > > - `usage' must be equal to TRUSTED_FOR_EXECUTION, so why does it > exist? Some future modes are planned? Please expand on this. Indeed, the current use case is to check if the kernel would allow execution of a file. But as Florian pointed out, we may want to add more context in the future, e.g. to enforce signature verification, to check if this is a legitimate (system) library, to check if the file is allowed to be used as (trusted) configuration… > > - `flags' is unused (must be zero). So why does it exist? What are > the plans here? This is mostly to follow syscall good practices for extensibility. It could be used in combination with the usage argument (which defines the user space semantic), e.g. to check for extra properties such as cryptographic or integrity requirements, origin of the file… > > - what values does the syscall return and what do they mean? > It returns 0 on success, or -EACCES if the kernel policy denies the specified usage.