From patchwork Tue Jul 25 14:12:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiu Jianfeng X-Patchwork-Id: 125649 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9010:0:b0:3e4:2afc:c1 with SMTP id l16csp2508985vqg; Tue, 25 Jul 2023 07:26:14 -0700 (PDT) X-Google-Smtp-Source: APBJJlGA1j75JGQBr3xEc4Y0sP2fyIgDmvMiwhdHK2LxhWa4NGHex/WDFrexzVe0af1v0qBgNZ6S X-Received: by 2002:a05:6358:3388:b0:134:e3d2:1e5d with SMTP id i8-20020a056358338800b00134e3d21e5dmr4712900rwd.22.1690295174392; Tue, 25 Jul 2023 07:26:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690295174; cv=none; d=google.com; s=arc-20160816; b=oOtjjWlFTUakpbMgKiXXEG14HK5GWiz0olQlFdGu5EPY1tStUDOR9mVbBEmsAkzsGW d9rbb84fVyLyPVHQGgSLaOARblxNeFfgt9OUQAXz0/caNVWPwWUdCCeRGtiqhtoLNWB+ 2QgLys3L40G4h61wSM9FGRd78vGVEwip6gKkAmqI9a5+NXieGP2Wc4Ccj7F+snf8J+sA zeFYryqTKYITQoGjh0EZEXa7GqGuzeGwe62QuMUVJlOBQ2CflNheuvOVN8IeQOTQhJOH lMg/izpaztJw2a6fv5fcPslUW5gv/S86gLz6yn+AXRlihXN9B2knrSE9GrQwTTDCV5Iv RgWw== 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 :message-id:date:subject:cc:to:from; bh=+Y9vL8ht/Oz7l0PJpfgKRG6lPSM+EVt5LIRhjXjurRk=; fh=4Lm+ZetbdDi0tHZrYTTLmV0UQ0ef7S1J05CPUPIrExg=; b=oJ3xNfNJzwvZPnE5ENt2DcpXK47IXCV27/4ZUnEJBR6H9UpfJxmeKdW7/g5ASjNRS/ 72qfhKII+YrAIDbvxHB1BtKR0mq3TAvz71LWEwJrlqbX5yclBCoPFsS8V9O5DWlvgPke BcYDbeKs+4S2vRLr+WZKPG1pAIb48d9Q3KxVCSKpvnF7ykHRCQiJBriQOUVIiXGelsnw MC34aTRVNyT7AMEQEQ2wYxiEOiY2gInAu8yqMs4s7lzohBA1Dq3igOmDllVndYAolAnc 5NQb4ZwEtFQ9hbbelj/w+LSwoDEN3A8s8hEJ+9uDfAqgxXLnE/aKzHK+0Yuu5EZupHPx bpEw== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e190-20020a6369c7000000b0055b6a782669si10749800pgc.261.2023.07.25.07.26.01; Tue, 25 Jul 2023 07:26:14 -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 S229659AbjGYOO1 (ORCPT + 99 others); Tue, 25 Jul 2023 10:14:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59948 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230017AbjGYOOZ (ORCPT ); Tue, 25 Jul 2023 10:14:25 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 38D6A1FCB; Tue, 25 Jul 2023 07:14:24 -0700 (PDT) Received: from dggpeml100024.china.huawei.com (unknown [172.30.72.56]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4R9Jsh0Gq7zrRx5; Tue, 25 Jul 2023 22:13:28 +0800 (CST) Received: from hulk-vt.huawei.com (10.67.174.26) by dggpeml100024.china.huawei.com (7.185.36.115) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Tue, 25 Jul 2023 22:14:20 +0800 From: Xiu Jianfeng To: , , , , CC: , , Subject: [PATCH -next] apparmor: cleanup unused functions in file.h Date: Tue, 25 Jul 2023 14:12:59 +0000 Message-ID: <20230725141259.233391-1-xiujianfeng@huawei.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Originating-IP: [10.67.174.26] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpeml100024.china.huawei.com (7.185.36.115) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772402952616436138 X-GMAIL-MSGID: 1772402952616436138 After changes in commit 33bf60cabcc7 ("LSM: Infrastructure management of the file security"), aa_alloc_file_ctx() and aa_free_file_ctx() are no longer used, so remove them, and also remove aa_get_file_label() because it seems that it's never been used before. Signed-off-by: Xiu Jianfeng Acked-by: John Johansen --- security/apparmor/include/file.h | 37 -------------------------------- 1 file changed, 37 deletions(-) diff --git a/security/apparmor/include/file.h b/security/apparmor/include/file.h index 5be620af33ba..23cb6f9dbe6e 100644 --- a/security/apparmor/include/file.h +++ b/security/apparmor/include/file.h @@ -45,43 +45,6 @@ struct aa_file_ctx { u32 allow; }; -/** - * aa_alloc_file_ctx - allocate file_ctx - * @label: initial label of task creating the file - * @gfp: gfp flags for allocation - * - * Returns: file_ctx or NULL on failure - */ -static inline struct aa_file_ctx *aa_alloc_file_ctx(struct aa_label *label, - gfp_t gfp) -{ - struct aa_file_ctx *ctx; - - ctx = kzalloc(sizeof(struct aa_file_ctx), gfp); - if (ctx) { - spin_lock_init(&ctx->lock); - rcu_assign_pointer(ctx->label, aa_get_label(label)); - } - return ctx; -} - -/** - * aa_free_file_ctx - free a file_ctx - * @ctx: file_ctx to free (MAYBE_NULL) - */ -static inline void aa_free_file_ctx(struct aa_file_ctx *ctx) -{ - if (ctx) { - aa_put_label(rcu_access_pointer(ctx->label)); - kfree_sensitive(ctx); - } -} - -static inline struct aa_label *aa_get_file_label(struct aa_file_ctx *ctx) -{ - return aa_get_label_rcu(&ctx->label); -} - /* * The xindex is broken into 3 parts * - index - an index into either the exec name table or the variable table