From patchwork Tue Aug 1 01:37:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiu Jianfeng X-Patchwork-Id: 13335664 X-Patchwork-Delegate: paul@paul-moore.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AA393C001DE for ; Tue, 1 Aug 2023 01:39:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229724AbjHABjJ (ORCPT ); Mon, 31 Jul 2023 21:39:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40430 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231879AbjHABjI (ORCPT ); Mon, 31 Jul 2023 21:39:08 -0400 Received: from dggsgout11.his.huawei.com (unknown [45.249.212.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 21DF419AE for ; Mon, 31 Jul 2023 18:39:07 -0700 (PDT) Received: from mail02.huawei.com (unknown [172.30.67.169]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4RFHnz2GgFz4f3prB for ; Tue, 1 Aug 2023 09:39:03 +0800 (CST) Received: from huaweicloud.com (unknown [10.67.174.26]) by APP3 (Coremail) with SMTP id _Ch0CgDH5CInYshkkPnZOA--.38043S4; Tue, 01 Aug 2023 09:39:03 +0800 (CST) From: Xiu Jianfeng To: paul@paul-moore.com, stephen.smalley.work@gmail.com, eparis@parisplace.org Cc: selinux@vger.kernel.org Subject: [PATCH -next] selinux: cleanup obsolete comments for selinux_hooks[] Date: Tue, 1 Aug 2023 01:37:18 +0000 Message-Id: <20230801013718.270018-1-xiujianfeng@huawei.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CM-TRANSID: _Ch0CgDH5CInY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-CM-SenderInfo: x0lxyxpdqiv03j6k3tpzhluzxrxghudrp/ X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: selinux@vger.kernel.org After commit f22f9aaf6c3d ("selinux: remove the runtime disable functionality"), the order in selinux_hooks[] does not affect any selinux function, so remove the comments. Signed-off-by: Xiu Jianfeng --- security/selinux/hooks.c | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index 2906fdaf7371..ef813970cb9c 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c @@ -6951,21 +6951,6 @@ static int selinux_uring_cmd(struct io_uring_cmd *ioucmd) } #endif /* CONFIG_IO_URING */ -/* - * IMPORTANT NOTE: When adding new hooks, please be careful to keep this order: - * 1. any hooks that don't belong to (2.) or (3.) below, - * 2. hooks that both access structures allocated by other hooks, and allocate - * structures that can be later accessed by other hooks (mostly "cloning" - * hooks), - * 3. hooks that only allocate structures that can be later accessed by other - * hooks ("allocating" hooks). - * - * Please follow block comment delimiters in the list to keep this order. - * - * This ordering is needed for SELinux runtime disable to work at least somewhat - * safely. Breaking the ordering rules above might lead to NULL pointer derefs - * when disabling SELinux at runtime. - */ static struct security_hook_list selinux_hooks[] __ro_after_init = { LSM_HOOK_INIT(binder_set_context_mgr, selinux_binder_set_context_mgr), LSM_HOOK_INIT(binder_transaction, selinux_binder_transaction), @@ -7201,9 +7186,6 @@ static struct security_hook_list selinux_hooks[] __ro_after_init = { LSM_HOOK_INIT(uring_cmd, selinux_uring_cmd), #endif - /* - * PUT "CLONING" (ACCESSING + ALLOCATING) HOOKS HERE - */ LSM_HOOK_INIT(fs_context_dup, selinux_fs_context_dup), LSM_HOOK_INIT(fs_context_parse_param, selinux_fs_context_parse_param), LSM_HOOK_INIT(sb_eat_lsm_opts, selinux_sb_eat_lsm_opts), @@ -7211,9 +7193,6 @@ static struct security_hook_list selinux_hooks[] __ro_after_init = { LSM_HOOK_INIT(xfrm_policy_clone_security, selinux_xfrm_policy_clone), #endif - /* - * PUT "ALLOCATING" HOOKS HERE - */ LSM_HOOK_INIT(msg_msg_alloc_security, selinux_msg_msg_alloc_security), LSM_HOOK_INIT(msg_queue_alloc_security, selinux_msg_queue_alloc_security),