From patchwork Tue Mar 14 08:17:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roberto Sassu X-Patchwork-Id: 69380 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp1630553wrd; Tue, 14 Mar 2023 01:23:57 -0700 (PDT) X-Google-Smtp-Source: AK7set8QpUcAg3sMHb3mNfzWisduO1zWxSzfAfds9NpX58uN5y24m2NYduVs7VCjryszpARKKKg1 X-Received: by 2002:a05:6a20:6a11:b0:c7:3c30:188f with SMTP id p17-20020a056a206a1100b000c73c30188fmr11396163pzk.20.1678782237182; Tue, 14 Mar 2023 01:23:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678782237; cv=none; d=google.com; s=arc-20160816; b=hl9EU+2GBFpXcJn2ICiZY01nxPbeqzvXn7703tB7yN+aXCd0aRkzxZ3GwanJERpnQV Mzmvy7ZIb9Rzuo97mnnsSpFF0sbM1kQWsi+ZXuOFD2Hyvpk+ZLQ86Ac/FXvrRwsySARo XrKNP0VIusqLYKVlH8QUaokW6htH8ebXOep+OSXlVF7JnntkA0XBY0yFwyS7Q/drxVqK 7LM16oiwhJkhLMWXj5uUfonRh3gx5YCUhfbceHkcNfBvDDIBXcMvj0bOzxTi+uM+cLkJ d3OZJ8h99IAw4BcoJDPfb0c3cCVB7Pg+XVrxKi3PmzGIpn8fC5i2rB0pz7z5XDzjYYQB RsCw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=Ad0cifB9sqBtIkbv3L5dFxiphcb2IsU1oR2YCApaMo4=; b=gNz27sNZgX8rrDArkysXo7odZ758lNOXksj9vgqnC8yYKayJFjKcbTlvCUdailibU9 aEXRmY4u1pDVdEEf87+kHQKVGI93Hk+3wcNbetKatJ5vrJP73STjLWIiVmIHAY8NOL1W AAZpWsnDMG81BcFeDirkn6T4dpfTCotdn2mNpuCOriCxNuJmPWewq4f5ha1v85j/kUTg ByB9W5h4jEdoCkqRz9i4OpbZf5l98QZCfefXmXh00Mbsp+L4pr394SWcu8qDOU3vKFfA 6uelmFXAIjAYxrU2B+N7+7mZDhY1nZIt1ydlhl2XoQm34qK30ZLpn1ktySAWnTMRFvgm oJig== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s10-20020a63450a000000b004fb15c9620dsi1664336pga.715.2023.03.14.01.23.44; Tue, 14 Mar 2023 01:23:57 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230001AbjCNIUV (ORCPT + 99 others); Tue, 14 Mar 2023 04:20:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59972 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230242AbjCNITv (ORCPT ); Tue, 14 Mar 2023 04:19:51 -0400 Received: from frasgout12.his.huawei.com (frasgout12.his.huawei.com [14.137.139.154]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA13B74A6E; Tue, 14 Mar 2023 01:19:04 -0700 (PDT) Received: from mail02.huawei.com (unknown [172.18.147.227]) by frasgout12.his.huawei.com (SkyGuard) with ESMTP id 4PbR5C4qlkz9xHN2; Tue, 14 Mar 2023 16:09:35 +0800 (CST) Received: from huaweicloud.com (unknown [10.204.63.22]) by APP2 (Coremail) with SMTP id GxC2BwBnNl2zLRBkenSXAQ--.34127S5; Tue, 14 Mar 2023 09:18:35 +0100 (CET) From: Roberto Sassu To: mark@fasheh.com, jlbec@evilplan.org, joseph.qi@linux.alibaba.com, zohar@linux.ibm.com, dmitry.kasatkin@gmail.com, paul@paul-moore.com, jmorris@namei.org, serge@hallyn.com, stephen.smalley.work@gmail.com, eparis@parisplace.org, casey@schaufler-ca.com Cc: ocfs2-devel@oss.oracle.com, reiserfs-devel@vger.kernel.org, linux-integrity@vger.kernel.org, linux-security-module@vger.kernel.org, selinux@vger.kernel.org, linux-kernel@vger.kernel.org, keescook@chromium.org, nicolas.bouchinet@clip-os.org, Roberto Sassu Subject: [PATCH v8 3/6] security: Remove security_old_inode_init_security() Date: Tue, 14 Mar 2023 09:17:17 +0100 Message-Id: <20230314081720.4158676-4-roberto.sassu@huaweicloud.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230314081720.4158676-1-roberto.sassu@huaweicloud.com> References: <20230314081720.4158676-1-roberto.sassu@huaweicloud.com> MIME-Version: 1.0 X-CM-TRANSID: GxC2BwBnNl2zLRBkenSXAQ--.34127S5 X-Coremail-Antispam: 1UD129KBjvJXoWxGryDZrW7Xw18WryDZry7ZFb_yoW5GryrpF 43t3WUGr1rJFyUWr1vyF17uF1SgFWrKrsrJrsakwnrJFnxZr1rtF1Fyr17CFyrJrW8Ww1I qw4a9r43Gr4DJrDanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUBYb4IE77IF4wAFF20E14v26rWj6s0DM7CY07I20VC2zVCF04k2 6cxKx2IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M28IrcIa0xkI8VA2jI8067AKxVWUWw A2048vs2IY020Ec7CjxVAFwI0_Xr0E3s1l8cAvFVAK0II2c7xJM28CjxkF64kEwVA0rcxS w2x7M28EF7xvwVC0I7IYx2IY67AKxVWUJVWUCwA2z4x0Y4vE2Ix0cI8IcVCY1x0267AKxV WxJVW8Jr1l84ACjcxK6I8E87Iv67AKxVW8JVWxJwA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_ Gr0_Gr1UM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI64kE6c02F40Ex7xfMc Ij6xIIjxv20xvE14v26r1j6r18McIj6I8E87Iv67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_ Jr0_Gr1lF7xvr2IYc2Ij64vIr41lFIxGxcIEc7CjxVA2Y2ka0xkIwI1l42xK82IYc2Ij64 vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s026x8G jcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r4a6rW5MIIYrxkI7VAKI48JMIIF0xvE2I x0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY6xkF7I0E14v26F4j6r4UJwCI42IY6xAI w20EY4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Jr0_Gr1lIxAIcVC2z280aVCY1x 0267AKxVW8JVW8JrUvcSsGvfC2KfnxnUUI43ZEXa7IU1c4S7UUUUU== X-CM-SenderInfo: purev21wro2thvvxqx5xdzvxpfor3voofrz/1tbiAgAQBF1jj4aJfgABsX X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE 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: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760330762978197239?= X-GMAIL-MSGID: =?utf-8?q?1760330762978197239?= From: Roberto Sassu As the remaining two users reiserfs and ocfs2 switched to security_inode_init_security(), security_old_inode_init_security() can be now removed. Out-of-tree kernel modules should switch to security_inode_init_security() too. Signed-off-by: Roberto Sassu Reviewed-by: Casey Schaufler Reviewed-by: Mimi Zohar --- include/linux/security.h | 12 ------------ security/security.c | 11 ----------- 2 files changed, 23 deletions(-) diff --git a/include/linux/security.h b/include/linux/security.h index 5984d0d550b..cd23221ce9e 100644 --- a/include/linux/security.h +++ b/include/linux/security.h @@ -336,9 +336,6 @@ int security_inode_init_security(struct inode *inode, struct inode *dir, int security_inode_init_security_anon(struct inode *inode, const struct qstr *name, const struct inode *context_inode); -int security_old_inode_init_security(struct inode *inode, struct inode *dir, - const struct qstr *qstr, const char **name, - void **value, size_t *len); int security_inode_create(struct inode *dir, struct dentry *dentry, umode_t mode); int security_inode_link(struct dentry *old_dentry, struct inode *dir, struct dentry *new_dentry); @@ -778,15 +775,6 @@ static inline int security_inode_init_security_anon(struct inode *inode, return 0; } -static inline int security_old_inode_init_security(struct inode *inode, - struct inode *dir, - const struct qstr *qstr, - const char **name, - void **value, size_t *len) -{ - return -EOPNOTSUPP; -} - static inline int security_inode_create(struct inode *dir, struct dentry *dentry, umode_t mode) diff --git a/security/security.c b/security/security.c index b808e1b8655..f4170efcddd 100644 --- a/security/security.c +++ b/security/security.c @@ -1655,17 +1655,6 @@ int security_inode_init_security_anon(struct inode *inode, context_inode); } -int security_old_inode_init_security(struct inode *inode, struct inode *dir, - const struct qstr *qstr, const char **name, - void **value, size_t *len) -{ - if (unlikely(IS_PRIVATE(inode))) - return -EOPNOTSUPP; - return call_int_hook(inode_init_security, -EOPNOTSUPP, inode, dir, - qstr, name, value, len); -} -EXPORT_SYMBOL(security_old_inode_init_security); - #ifdef CONFIG_SECURITY_PATH /** * security_path_mknod() - Check if creating a special file is allowed