Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2156308iof; Tue, 7 Jun 2022 21:38:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJybmM5Kopgr5n+2hmrWO2qdfC2gAsv87NHcwCOrmg5gybhnEvg7LwRHC8Q/5mfQ2s4UQx/x X-Received: by 2002:a17:903:2344:b0:163:ce0a:4655 with SMTP id c4-20020a170903234400b00163ce0a4655mr32534004plh.122.1654663101646; Tue, 07 Jun 2022 21:38:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654663101; cv=none; d=google.com; s=arc-20160816; b=j6KsVUpThvHBDSlPfJvB3YFhwU3FajEjmlCw2C9hJxcgqa1ieF8H/ALeeWQdHbxkQW 5L4fwg2JQWdJ1ZIMzyKQ8cQ+bWS1q5RLe3BUaMuMRYpqRI7clvaTwHpLig+/qqKu2dEX 3sLlDuaXGNrNzSf0GnKuTGlyPVucr8xAMU6J5Bea/sfCVxJvV+2AxVYisSyquRvjzo2p nBDmYUs4YkplHSEp5X3X/1ZvB6zYgtaKzLYN8SRnd02ZTn5+IAonPY6FaSTXq3mAqXIf k3dekpqm7s8qGq4NuKN1o3U6XFkR9bHlRPeKfoGNv/kMqJ5p+UtTBvJ7a8NASvzSOWeL e/FQ== 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=WpWZEWVMXUr4lxWGd2eXKwMp+29v2+B5FhAaQYxF4+6r90itrGQkRZABuB9N8cu1CG WOHmWUylPQV6q4AV5Bmb3rdTvhfIT5s6iaanjDlfXLRj9ERydjkAUCrzG3lRzOIpfMSD PIBJDzvT4Okf+akWnQ9mAkR0fuqADNQHdyeAXp0xbfw5GYjKDmm/HvfynRMTkuFgzZlv N14nsAiYbAjpp+II21mcbKsEUVKt2djZnbm/GXPsK2RGKRzS5UC9ofs97fHVH1moJhdv gmDFYAsp0fiWCXw4NXpJK5EfA/MP6+IDdN1Dbkpo2emuvbq1vENFs8DF/wP3Ms2V+Ry/ Qoiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=o+ycQWLE; 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 j9-20020a170903024900b00161f6d845easi28687382plh.229.2022.06.07.21.38.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 21:38:21 -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=o+ycQWLE; 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 E0F0B4346B3; Tue, 7 Jun 2022 21:08:37 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378589AbiFGVrc (ORCPT + 99 others); Tue, 7 Jun 2022 17:47:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377968AbiFGUvP (ORCPT ); Tue, 7 Jun 2022 16:51:15 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BF76E184869; Tue, 7 Jun 2022 11:41:04 -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 ams.source.kernel.org (Postfix) with ESMTPS id 82092B82182; Tue, 7 Jun 2022 18:41:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E7379C385A2; Tue, 7 Jun 2022 18:41:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654627262; bh=YIivGeXXRfB6Sue+gelH2WioHvR7o0hxg8DWNPtEYV4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=o+ycQWLERCsuaMwg8T/t6xrVsKZzlIDtw5Ti7yNz0VLzoJBP68I6dTHP6LSi0Zaxn OH1vZC/DyMcsXkQcjQf9zd03tmWaEJVdJYDtoqrs26VJtfXP2OIOBA2lfeDOFCHuGj OONY3uq8couzEGl1ipre1lyxtQFRJ5LzOMZ90Hl0= 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.17 675/772] landlock: Fix landlock_add_rule(2) documentation Date: Tue, 7 Jun 2022 19:04:27 +0200 Message-Id: <20220607165008.950089574@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607164948.980838585@linuxfoundation.org> References: <20220607164948.980838585@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. */