Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp1268325rwe; Sat, 27 Aug 2022 04:42:42 -0700 (PDT) X-Google-Smtp-Source: AA6agR62msI6CdGaeYufxXcVzV6kdUNzhHt7KiIr1X3JysXQzSI966FvrofPQDHE3I2e2sVn7T32 X-Received: by 2002:a05:6402:11cd:b0:43d:7862:7c25 with SMTP id j13-20020a05640211cd00b0043d78627c25mr10135490edw.96.1661600562718; Sat, 27 Aug 2022 04:42:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661600562; cv=none; d=google.com; s=arc-20160816; b=NqLdKDxLCOigU11cPmc7bc4YI8aNPJnA2VH3gVcfUZQLZU7/cMdf1XGofegjaKYNZE mmciMlFdHx/zZD6Nmw6BTbZMkYKjPX3Lgzz4Edf1sqsnetLvtOibpY2F+jDMmMZbtdeN JCqh4KM894hmigRrenJh6bXzQhsVn5t1N2e0ezy3xH4O0agq1Ep4a5IcC6r7mgWnXB81 oCPbHgybFm9tAVSaHNZl2p/8TvlzaZMn9aVoe0go4td4HVY6+VLmaWO/6BrbWvmfMY+2 NdJ79j4ruBK8tGYZgiHtjIUJxD0as7SWAiJsQwe4rtkItIHUXJc4OBp62um+sCDZT66u xrag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=nzrJY3ldH0XmBNVWrk7uCvOCSwrF8ctJMm7luV+XhP8=; b=eT/QHZeZmU0xrreFYcJPHIYI8Zt++jPz79BaH6JHDCPjkgrvFj5t1MA38FGNHv9zoZ CCxbQ6O5Wl/5bqnAqFVkKlioFHHup2Bc3v3pv6C7Iw+nChbAJl31sd9ad5zAYhEvzr6j pmLl0L90rlFbm6RIEvlaXFt8sTKHmyyfxBPbSNjnRqqMCSaWfMuGWS1lqHitP4jnveDY d9MgRsOD80PbRczLwgiqMWLyqDmimiICY35Qb7+gkf21HVbz4/UXo+yoEaBkLh1wqhP7 O2nHn7QKmIe0OwVTeBiWFmyHmnxqy6V0Nj5H9rXL7c0ZvkYOM0d1QfRPylSQm4rRLRXH GM3g== 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 b11-20020a170906708b00b0073d9b03865asi2508345ejk.706.2022.08.27.04.42.17; Sat, 27 Aug 2022 04:42:42 -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 S242664AbiH0LPz (ORCPT + 99 others); Sat, 27 Aug 2022 07:15:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233696AbiH0LPw (ORCPT ); Sat, 27 Aug 2022 07:15:52 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 126143880; Sat, 27 Aug 2022 04:15:50 -0700 (PDT) Received: from dggpeml500023.china.huawei.com (unknown [172.30.72.55]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4MFDbB2yTnznTYZ; Sat, 27 Aug 2022 19:13:26 +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; Sat, 27 Aug 2022 19:15:48 +0800 From: Xiu Jianfeng To: , , , , , CC: , , , Subject: [PATCH -next v2 0/6] landlock: add chmod and chown support Date: Sat, 27 Aug 2022 19:12:09 +0800 Message-ID: <20220827111215.131442-1-xiujianfeng@huawei.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.67.174.58] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) 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 v2: * abstract walk_to_visible_parent() helper * chmod and chown rights only take affect on directory's context * add testcase for fchmodat/lchown/fchownat * fix other review issues Xiu Jianfeng (6): landlock: expand access_mask_t to u32 type landlock: abstract walk_to_visible_parent() helper landlock: add chmod and chown support landlock/selftests: add selftests for chmod and chown landlock/samples: add chmod and chown support landlock: update chmod and chown support in document Documentation/userspace-api/landlock.rst | 9 +- include/uapi/linux/landlock.h | 10 +- samples/landlock/sandboxer.c | 13 +- security/landlock/fs.c | 110 ++++++-- security/landlock/limits.h | 2 +- security/landlock/ruleset.h | 2 +- security/landlock/syscalls.c | 2 +- tools/testing/selftests/landlock/base_test.c | 2 +- tools/testing/selftests/landlock/fs_test.c | 267 ++++++++++++++++++- 9 files changed, 386 insertions(+), 31 deletions(-) -- 2.17.1