Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2197873iof; Tue, 7 Jun 2022 22:57:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyOmntzfhJ2x+zJijX3oisKuyT0TpawtAAkLOVNBYMHvoYxcRRTI8i7grmdEd5ozOrwNL1+ X-Received: by 2002:a17:902:9348:b0:167:8e92:272f with SMTP id g8-20020a170902934800b001678e92272fmr8645211plp.77.1654667859326; Tue, 07 Jun 2022 22:57:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654667859; cv=none; d=google.com; s=arc-20160816; b=MWk4byzSjAxqVO5mZoYcWoj9dX0JIpvDG/yhtqTH9f7p/o6TnJvCl4iQcp2cAhwOtp 0EjdlLx5p/+zXDAqu3Wc+gyNCsxYFxGqzTO2zgGY+XENXeTbMZm+Z8EPi4LNKIy2o3UU 9mYkVOe9TfTw9aXROmK+On2Z2OSVqwivQf3sL4KJ3uCvxVCrCmY8GLpxF9131ciPzg4n 3tOCbHjqTzJKlM7UYMQcNqL4oDVwvQbLHm3KKyvEqWs+WMMhkPM6LqxUP3LKIbyVSVXh NiDca3yZOEEb6fPURlWJs2jWpHCSCu8X9yCIbqvQ0ZzKK/bL+ykuARHDfmsB6ZxrIcfE +ziQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=gaklmLrhUHbQHZt+eeqjXKP5zFxZInbgquQZR6Wd6CM=; b=IFZIcPvHEGXQdO+ZZuXWKdFqDxKezZtml16swFSJEjl8iWE9lrKuQCW3Lg4HmCBVM2 QthFqD452PqSSHY1jBnY07/QPKjTjG4nZzhWorPHvIgmxosx8gnXGMpU91LRbCNuDIls CMd3m7Q4CqWdkdPL8X4Mgr3r10jOjhelU2Ammh1RlytNIXR2P0TAXvDuy8vc2VOxTZYn BYhIAuaOcwLqUSDJiAFZpxkq3K6kHhCl7yQ1sl5hlucAzDmcI5c5V7CYijtKeK0xfncm 1xCxRkrzuLqg8vxkM87GpH0AxizlpIUNEL4BktH6kGiK0EI9CRVKlTsG3azxkc+zg/oF IVjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="J/thVNzV"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id lk13-20020a17090b33cd00b001e3446e5c51si15454570pjb.179.2022.06.07.22.57.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 22:57:39 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="J/thVNzV"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6538F4B4175; Tue, 7 Jun 2022 22:23:21 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244856AbiFHBC7 (ORCPT + 99 others); Tue, 7 Jun 2022 21:02:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49884 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1385263AbiFGWVX (ORCPT ); Tue, 7 Jun 2022 18:21:23 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 61E7026714C; Tue, 7 Jun 2022 12:21:18 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 4BB23600E1; Tue, 7 Jun 2022 19:21:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5AE22C385A5; Tue, 7 Jun 2022 19:21:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654629674; bh=YIivGeXXRfB6Sue+gelH2WioHvR7o0hxg8DWNPtEYV4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=J/thVNzVhAbi0odMCe5GYZAmHOvM53KLft4PVcS2xcc7Lxw9OfS0cqeHm1lUE499J OJd/Z6lUzekGjXqrqvhITJdw+RCv+vCJ+gKjpB/CN5fqEnmbjEK/idIWXXUNVpbmRG ukvkjfsAi2NMRqk0bkzOVOH/jBvVDaapmkT2r79o= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Micka=C3=ABl=20Sala=C3=BCn?= Subject: [PATCH 5.18 777/879] landlock: Fix landlock_add_rule(2) documentation Date: Tue, 7 Jun 2022 19:04:55 +0200 Message-Id: <20220607165025.424498434@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607165002.659942637@linuxfoundation.org> References: <20220607165002.659942637@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, 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=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 commit a13e248ff90e81e9322406c0e618cf2168702f4e upstream. It is not mandatory to pass a file descriptor obtained with the O_PATH flag. Also, replace rule's accesses with ruleset's accesses. Link: https://lore.kernel.org/r/20220506160820.524344-2-mic@digikod.net Cc: stable@vger.kernel.org Signed-off-by: Mickaël Salaün Signed-off-by: Greg Kroah-Hartman --- include/uapi/linux/landlock.h | 5 +++-- security/landlock/syscalls.c | 7 +++---- 2 files changed, 6 insertions(+), 6 deletions(-) --- 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; /* --- a/security/landlock/syscalls.c +++ b/security/landlock/syscalls.c @@ -292,14 +292,13 @@ out_fdput: * * - 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. */