Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1192435pxb; Tue, 29 Mar 2022 20:04:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxxR7+LhNws7q3T8+idlCRhGGgrBjNQfKt0qU4dWN/crltb8kJO7PriVaYmne3j1mEf6VhR X-Received: by 2002:a17:907:b590:b0:6c1:c061:d945 with SMTP id qx16-20020a170907b59000b006c1c061d945mr37829039ejc.768.1648609471333; Tue, 29 Mar 2022 20:04:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648609471; cv=none; d=google.com; s=arc-20160816; b=g9QFGsZWkBN/Nh8kZzWnpXNmWLcYtEczwO0T+5BiXH24lLFafT2YT/dS171uWu2iIQ sZw8tDhyXjlPnyyFjH7Hs+KVNKXksuRr+thFJX3NRNRET4YdRE208WThTYT/JxZTNv5i ioR87Ofu1/kbeh6ITMYaDAo9QhOAnw6b5g9vRA0XXvLWAok3Cbi5zC6P/Wo8IYhpq1B6 /+aVzRgVd3E+k+7IWXACGFnri46jizuBrG7FgcN8os+6y3O9t/qOUNqr+V81Hikmr8ux +z3wxDzVqwLUkIrLtGRm0Vnpot69PAdpPXXpaLx40aRSFr0EMjSsDOi/M+HgvE2CQWWX YTVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=QWIhgocupTE12ujJ10inEeLXjB2bqxauou/TmtS6HmY=; b=J37UW6Aw6hb8bwP4amv2G/WNFpXmj6vczwAf7xEYK2wtVPdicduZyE4J2+5Gd0XQkK XkWTDf58KYnKo+NtCIyHpumMwAjPiANCaUsB/fG/Psa9QSKhilz//25jLB3EAfh7Aszn 7cx49o1ft1rvC7Wz9cDV8/q99qaqkE/5WLTVH/a92qUppGi5bXj//WUdi68dSDjEHFBT k49wDwhdZ+XMz7IwR5hQPVTpMqybYTpkaUI4OL9a6F1JqgalxUxC7ebH9OR4jevDfyJZ z9LahmgS5ub9oe6ZQ97rSc1XWUGZl+x0sFjk99W5dkxi7s1fdeMNSim/R67/bMdFZFsS Y6rg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@digikod.net header.s=20191114 header.b=0Spx8mfv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k8-20020a50cb88000000b00419339928a4si19458944edi.584.2022.03.29.20.04.05; Tue, 29 Mar 2022 20:04:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@digikod.net header.s=20191114 header.b=0Spx8mfv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236989AbiC2MyF (ORCPT + 99 others); Tue, 29 Mar 2022 08:54:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237214AbiC2MxD (ORCPT ); Tue, 29 Mar 2022 08:53:03 -0400 Received: from smtp-bc08.mail.infomaniak.ch (smtp-bc08.mail.infomaniak.ch [IPv6:2001:1600:4:17::bc08]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 474411AF2B; Tue, 29 Mar 2022 05:51:09 -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 4KSTvc1kLVzMq173; Tue, 29 Mar 2022 14:51:08 +0200 (CEST) Received: from localhost (unknown [23.97.221.149]) by smtp-3-0001.mail.infomaniak.ch (Postfix) with ESMTPA id 4KSTvb754VzlhMbh; Tue, 29 Mar 2022 14:51:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=digikod.net; s=20191114; t=1648558268; bh=smcHkSzsHA9UZrPxO4w4wuj0alDdabBqgJAayQUQddQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0Spx8mfvteAOpN5mHxVWCFqncvkCGz4WPO4np6Z2DNZsi685wIXBij4Q3qpCU9Ld2 FYuOBVwBQZf04SFcEHQwAnZS+4Nwf8pOPhvrFsZI9Vl11zKUyHZvi0UwUZpKkk05T9 e4rIBNgAen+ssbWfvNqAQUta5mFhqHmg5KMuu870= From: =?UTF-8?q?Micka=C3=ABl=20Sala=C3=BCn?= To: James Morris , "Serge E . Hallyn" Cc: =?UTF-8?q?Micka=C3=ABl=20Sala=C3=BCn?= , Al Viro , Jann Horn , John Johansen , Kees Cook , Konstantin Meskhidze , Paul Moore , Shuah Khan , Tetsuo Handa , linux-doc@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org, =?UTF-8?q?Micka=C3=ABl=20Sala=C3=BCn?= Subject: [PATCH v2 12/12] landlock: Add design choices documentation for filesystem access rights Date: Tue, 29 Mar 2022 14:51:17 +0200 Message-Id: <20220329125117.1393824-13-mic@digikod.net> In-Reply-To: <20220329125117.1393824-1-mic@digikod.net> References: <20220329125117.1393824-1-mic@digikod.net> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mickaël Salaün Reviewed-by: Paul Moore Signed-off-by: Mickaël Salaün Link: https://lore.kernel.org/r/20220329125117.1393824-13-mic@digikod.net --- Changes since v1: * Add Reviewed-by: Paul Moore. * Update date. --- Documentation/security/landlock.rst | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/Documentation/security/landlock.rst b/Documentation/security/landlock.rst index 3df68cb1d10f..eb4905993a59 100644 --- a/Documentation/security/landlock.rst +++ b/Documentation/security/landlock.rst @@ -7,7 +7,7 @@ Landlock LSM: kernel documentation ================================== :Author: Mickaël Salaün -:Date: March 2021 +:Date: March 2022 Landlock's goal is to create scoped access-control (i.e. sandboxing). To harden a whole system, this feature should be available to any process, @@ -42,6 +42,21 @@ Guiding principles for safe access controls * Computation related to Landlock operations (e.g. enforcing a ruleset) shall only impact the processes requesting them. +Design choices +============== + +Filesystem access rights +------------------------ + +All access rights are tied to an inode and what can be accessed through it. +Reading the content of a directory doesn't imply to be allowed to read the +content of a listed inode. Indeed, a file name is local to its parent +directory, and an inode can be referenced by multiple file names thanks to +(hard) links. Being able to unlink a file only has a direct impact on the +directory, not the unlinked inode. This is the reason why +`LANDLOCK_ACCESS_FS_REMOVE_FILE` or `LANDLOCK_ACCESS_FS_REFER` are not allowed +to be tied to files but only to directories. + Tests ===== -- 2.35.1