Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4669271iob; Sun, 8 May 2022 21:19:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzakab3efqTJ6XbeQLjP+u3HelgUvA3IKZX1Bt4jHkYj3pxyWRIrAMyDZ2dttdJJQ/5tDq2 X-Received: by 2002:a17:90a:694d:b0:1dc:e471:1a71 with SMTP id j13-20020a17090a694d00b001dce4711a71mr13634468pjm.65.1652069961116; Sun, 08 May 2022 21:19:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652069961; cv=none; d=google.com; s=arc-20160816; b=EAp4cmUzKIX+cD6zHba4HtLmKs/cK7cpVkpGEdqq1SbZi+Wd/TbYhbDRG0CKtssLas 5GwDdbyvc5NOnnIGMU2t+p0f252cpn6GCqgULoeBF8veEqTXFcZHg6xSUUzSUIMozfiq noYkEIo2o2UBSGQwqCZmbIe/f5vuLIICHOBjb9wJwR4PulIdkRRLE4d3WkaQ1I7sjEBd 5rTpMyRflKODT8ypjCBDWpwKBGEyLjcBQ0ZzjNc3RuyX66guX2zdlTE0VON3v2uh6eoq HfLgKLK4A7z4KS7J94UkYA/irTMe2kXSF1Bx22LB3C9edWcrjxWUr67iUCJgnOccRfjf QNbw== 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=WapPYFzonO9uCKjnnn7SLv1ttuW8tOGFMXHDbOMS+3U=; b=AUfAdj0ScUgJe/dY1EjJBWFwRbUbKj18M/cBthOKBbH7P1/VPW88KEh8YpEVwDLrDO 1gMJu9odGdcKJDAVdYciuKXvIIqf9QfpN1OD2xU72EGon3QQgLAzc+36yhKH0WJvd87c TO7u9+hwbmpPmao2+4kw3XtprnJOdnyUAal2sOXn25VevpltxY7pULAT87mohsEWCvH2 w1ZSJ1Zx0Puk/yyChTOWpQrsTHenJbvSlW4PIs4wDq7WMbLNiFV1bN+XvneID1WRRBH+ 9vz2uHr/UKAql0G36HVBI1EyQvrKjUxZFmMU0/SeQWvK+ys/1JnpxNnieeDsoH7nu6gE Nm2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@digikod.net header.s=20191114 header.b=mvtnmkxj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id m6-20020a170902db0600b00153b2d1652csi12129703plx.308.2022.05.08.21.19.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 May 2022 21:19:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@digikod.net header.s=20191114 header.b=mvtnmkxj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C318A2D1F8; Sun, 8 May 2022 21:16:10 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1443473AbiEFQK6 (ORCPT + 99 others); Fri, 6 May 2022 12:10:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43124 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1443433AbiEFQKr (ORCPT ); Fri, 6 May 2022 12:10:47 -0400 Received: from smtp-8faf.mail.infomaniak.ch (smtp-8faf.mail.infomaniak.ch [83.166.143.175]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F6A02E2; Fri, 6 May 2022 09:07:00 -0700 (PDT) Received: from smtp-2-0000.mail.infomaniak.ch (unknown [10.5.36.107]) by smtp-2-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4KvwS22VjzzMqwSb; Fri, 6 May 2022 18:06:58 +0200 (CEST) Received: from localhost (unknown [23.97.221.149]) by smtp-2-0000.mail.infomaniak.ch (Postfix) with ESMTPA id 4KvwS20gxszlhSLv; Fri, 6 May 2022 18:06:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=digikod.net; s=20191114; t=1651853218; bh=yivXrqwHOjEJuB5JO2dFkVkVifT0vIdSPlaZ68dxcTE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mvtnmkxj8G1I3mF9KjXpG4pgD7uoCILsZIPoo5A7yu4bfGGeLBSKir4P1G2+Bug/W PHN2E38FCKMoMVLe7wIYjF2pABAeE9nCUAece9ecWukrrw27RRIc5wcPMLuZSNxcT0 Grtvtx+sJ/JoLha/UImCZLqdx93NLKZlkj+qVEo4= 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?= , Jann Horn , Kees Cook , Konstantin Meskhidze , Nathan Chancellor , Nick Desaulniers , Paul Moore , Shuah Khan , linux-api@vger.kernel.org, linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org Subject: [PATCH v2 01/10] landlock: Fix landlock_add_rule(2) documentation Date: Fri, 6 May 2022 18:08:11 +0200 Message-Id: <20220506160820.524344-2-mic@digikod.net> In-Reply-To: <20220506160820.524344-1-mic@digikod.net> References: <20220506160820.524344-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.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 It is not mandatory to pass a file descriptor obtained with the O_PATH flag. Also, replace rule's accesses with ruleset's accesses. Signed-off-by: Mickaël Salaün Link: https://lore.kernel.org/r/20220506160820.524344-2-mic@digikod.net --- include/uapi/linux/landlock.h | 5 +++-- security/landlock/syscalls.c | 7 +++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/uapi/linux/landlock.h b/include/uapi/linux/landlock.h index 15c31abb0d76..21c8d58283c9 100644 --- a/include/uapi/linux/landlock.h +++ b/include/uapi/linux/landlock.h @@ -62,8 +62,9 @@ struct landlock_path_beneath_attr { */ __u64 allowed_access; /** - * @parent_fd: File descriptor, open with ``O_PATH``, which identifies - * the parent directory of a file hierarchy, or just a file. + * @parent_fd: File descriptor, preferably opened with ``O_PATH``, + * which identifies the parent directory of a file hierarchy, or just a + * file. */ __s32 parent_fd; /* diff --git a/security/landlock/syscalls.c b/security/landlock/syscalls.c index 2fde978bf8ca..7edc1d50e2bf 100644 --- a/security/landlock/syscalls.c +++ b/security/landlock/syscalls.c @@ -292,14 +292,13 @@ static int get_path_from_fd(const s32 fd, struct path *const path) * * - EOPNOTSUPP: Landlock is supported by the kernel but disabled at boot time; * - EINVAL: @flags is not 0, or inconsistent access in the rule (i.e. - * &landlock_path_beneath_attr.allowed_access is not a subset of the rule's - * accesses); + * &landlock_path_beneath_attr.allowed_access is not a subset of the + * ruleset handled accesses); * - ENOMSG: Empty accesses (e.g. &landlock_path_beneath_attr.allowed_access); * - EBADF: @ruleset_fd is not a file descriptor for the current thread, or a * member of @rule_attr is not a file descriptor as expected; * - EBADFD: @ruleset_fd is not a ruleset file descriptor, or a member of - * @rule_attr is not the expected file descriptor type (e.g. file open - * without O_PATH); + * @rule_attr is not the expected file descriptor type; * - EPERM: @ruleset_fd has no write access to the underlying ruleset; * - EFAULT: @rule_attr inconsistency. */ -- 2.35.1