Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp2250001rwa; Mon, 22 Aug 2022 04:58:10 -0700 (PDT) X-Google-Smtp-Source: AA6agR4C+JjC7cL+wvUx3sGnsAZuA5TfNwD5yyeRkhv/sAyZbnxHLJSjuPqRTXKZ4GgXW/1guQzj X-Received: by 2002:a17:907:168b:b0:73d:85cf:2be0 with SMTP id hc11-20020a170907168b00b0073d85cf2be0mr1960290ejc.303.1661169490638; Mon, 22 Aug 2022 04:58:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661169490; cv=none; d=google.com; s=arc-20160816; b=jNOaFzNzSyRL78GqGmHGd6DQBEABckr5RNDDlUv85Zl1YklS1f3AjzKNOEM/sO46Fj K8ScHsqS8zaXU/hH4u0bKRa+m1MJOnckszEVJQU6TL6/FZanRHgNOnaXrHp1gRwVQzwB 5l5JiREassjz8PgkJFG36pcop/Ndbn5Hi2owVi98wxYRc0Tg0viqYToVU5zyzIQY/ztM tDgaFngiw718jMwrAIjI0NG9gvijOU16Fefdzrg6wuX8pTn8TK/APQHHDI6pXwhGEOeY hpnFZgSgp+5vrsgVDNv6a5RQbU61WPbQcj+MeT0osoq9pgbzrcUZdtmAlEM+UFoPojlx /1aA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=kPAQFaz2+fZiTKr4XHhZYow64anTZHh5b+fIm5vNBKY=; b=W49WMhPwZM0kmtW0q9DckvlNs1ZZtYWDuhfkzstNPmKNxC8u0hIy1lU6ihPq1GqLJp gLgqFPxKnUAUjWn6MA3Y+W2Ry7cshbIXgg427xXlQq/dZHVAmW6nwWySOVgt0bqTOlvf sC3F8aU8HNGSDDSkYo1kn8rsJ0ztbUOXJzVxblW+QmhBfnxz/TMM6c/pf1zxVILRB0O7 hmlY9koVgOB3nK1EZ1IMsRfJKY5ut0IZB0LX1npVq37TAYwgDYxEt9BAm23qSAq0NZP7 pzWWXMyt0ICcb8nvrkuOp7ciCCrnNDACZR0wkNMw/2l2E/uCwriZs9jjRDxBcRzemPNA QWIw== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s12-20020a1709064d8c00b00732fce8c673si3982482eju.883.2022.08.22.04.57.45; Mon, 22 Aug 2022 04:58:10 -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; 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; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234655AbiHVLv7 (ORCPT + 99 others); Mon, 22 Aug 2022 07:51:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52544 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234870AbiHVLuR (ORCPT ); Mon, 22 Aug 2022 07:50:17 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 11F34B862; Mon, 22 Aug 2022 04:50:17 -0700 (PDT) Received: from dggpeml500023.china.huawei.com (unknown [172.30.72.53]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4MB9Yz4dSfz1N7Tt; Mon, 22 Aug 2022 19:46:47 +0800 (CST) Received: from ubuntu1804.huawei.com (10.67.174.58) by dggpeml500023.china.huawei.com (7.185.36.114) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Mon, 22 Aug 2022 19:50:14 +0800 From: Xiu Jianfeng To: , , , , , CC: , , , Subject: [PATCH -next 5/5] landlock: update chmod and chown support in document Date: Mon, 22 Aug 2022 19:47:01 +0800 Message-ID: <20220822114701.26975-6-xiujianfeng@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220822114701.26975-1-xiujianfeng@huawei.com> References: <20220822114701.26975-1-xiujianfeng@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.67.174.58] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpeml500023.china.huawei.com (7.185.36.114) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 update LANDLOCK_ACCESS_FS_{CHMOD, CHOWN} support and add abi change in the document. Signed-off-by: Xiu Jianfeng --- Documentation/userspace-api/landlock.rst | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Documentation/userspace-api/landlock.rst b/Documentation/userspace-api/landlock.rst index 2509c2fbf98f..05ab338db529 100644 --- a/Documentation/userspace-api/landlock.rst +++ b/Documentation/userspace-api/landlock.rst @@ -61,7 +61,9 @@ the need to be explicit about the denied-by-default access rights. LANDLOCK_ACCESS_FS_MAKE_BLOCK | LANDLOCK_ACCESS_FS_MAKE_SYM | LANDLOCK_ACCESS_FS_REFER | - LANDLOCK_ACCESS_FS_TRUNCATE, + LANDLOCK_ACCESS_FS_TRUNCATE | + LANDLOCK_ACCESS_FS_CHMOD | + LANDLOCK_ACCESS_FS_CHOWN }; Because we may not know on which kernel version an application will be @@ -90,6 +92,10 @@ the ABI. case 2: /* Removes LANDLOCK_ACCESS_FS_TRUNCATE for ABI < 3 */ ruleset_attr.handled_access_fs &= ~LANDLOCK_ACCESS_FS_TRUNCATE; + case 3: + /* Removes LANDLOCK_ACCESS_FS_{CHMOD, CHOWN} for ABI < 4 */ + ruleset_attr.handled_access_fs &= ~(LANDLOCK_ACCESS_FS_CHMOD | + LANDLOCK_ACCESS_FS_CHOWN); } This enables to create an inclusive ruleset that will contain our rules. -- 2.17.1