Received: by 2002:ab2:b82:0:b0:1f3:401:3cfb with SMTP id 2csp990667lqh; Fri, 29 Mar 2024 03:57:36 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXsJp3jmxJwokRuF/+7YJzSnJ3WKIoIWcBXRWka3+Zqe32/vxdH18t1xv+NzswhUC2+wZw7e2spFyzmGBIcquRn9GV2Y0kAOCO+Yo/XgA== X-Google-Smtp-Source: AGHT+IEBEGPUAjvN5v6UUTTI4XEmnWojwFVGecjg54utGBxmqee4iCYEp2yMSCAadF8sQSGRfPrL X-Received: by 2002:a05:6a20:b1a8:b0:1a3:7c1f:65e with SMTP id ee40-20020a056a20b1a800b001a37c1f065emr1535428pzb.31.1711709856561; Fri, 29 Mar 2024 03:57:36 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711709856; cv=pass; d=google.com; s=arc-20160816; b=AXRnigJ4FNfKFuGuzaW4vM867bptyUdOH+5SZnrHLc+BvP3wL8sK/aTBGGaeX7k5Wr BlS7HHOzmWwYLR0q9ur+43DR5h9qk7QAtXIs5WjlsEeequuLfojASec7DtbVr5/ynaZU eaOafqIVI39qbbBEfdRT97+HCDga4RjO1iKsQZLxnEWbaW4UxIA7EQ/js61qtpV8dRWH ueWOk622Q7iu4+RbwCAbg7A+KsSyUZyi0KDWe21jRMe3v5wPnhp2SJUrDWaDHNXIymKz VVYXpYPsA8WIMV0xqfW9aL/lxHK/l+vIrAccaz2MrjMj9fR1GMFS9e4xVmeEm6yyCLkm /byg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=iKbUeI2JJjbRZkZCReCAda2Wk+MlWHpUme6TOk9yKvY=; fh=p2DI57KVOWHrx1oW0/ZGJFbNqhUsWqjaEcfiJpIyeKY=; b=m0h9D1vJoO5E42HtZo8w+VMjO2S28pp6rbIQKiEtEj4OHOY1TJ8K+X/4IXlueabgdU sU/213m/bu3fgWcd5WpuVxJHA3XC7/ramje7aERXhN0MldQ/mOQF0ND1TbME+EcRztej dir1Dkw//Xp7ccwaFaNt7tm3bfHlk4eSh4gK8kQRHhK/lGgrr3lgcqvZCOZ0Hfam6wMb ts29luVwa6pSd0/QyzzWTTT6LnxjZkwT/2d8kpWOYk1ZdLjWse/1ABmGio8y+Kd8tCfy EJniFjHedp8brKm2pt43HNkuGhvvvL6BqqBEJMDb0TgjlUOcgysRTsP2427BhweTGio1 9hAA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huaweicloud.com); spf=pass (google.com: domain of linux-kernel+bounces-124410-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-124410-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id w3-20020a056a0014c300b006ead0dcb8bcsi3675817pfu.0.2024.03.29.03.57.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Mar 2024 03:57:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-124410-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huaweicloud.com); spf=pass (google.com: domain of linux-kernel+bounces-124410-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-124410-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 1C6B628790F for ; Fri, 29 Mar 2024 10:57:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 875E67E104; Fri, 29 Mar 2024 10:56:49 +0000 (UTC) Received: from frasgout11.his.huawei.com (frasgout11.his.huawei.com [14.137.139.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9055B6A347; Fri, 29 Mar 2024 10:56:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=14.137.139.23 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711709808; cv=none; b=c00wy0XMaSNOxa7gO6jb4/GUio+kk0Z/cD9nd6wbPTuY5Opkk0eFFwXJWNBI8AHvgqU7RaORrb/wK7y/SaGiOdJW1kOXBPPzEGvmvr9de4ozCNO3oOVCdnSCYO/Xno7+tsckXynHZtq2N99vm57VXroiPojo1sVzj36kFQ5Jntw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711709808; c=relaxed/simple; bh=JczRvhAxp0oCK7GkF7t5XGDG+V3gmMYtZapyAPDTA+8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=nu99oGNa6aorOYW03eAse7dQV6Ou5BEzb6aG7CInHntNpEqGALY/FgPWyGU7kJlQB9YEruqI8a8NMyJhrQiiHsfnXb2CgirRL7bD81gvn1XeAnuqCay9UOgC2dCQPUfeHbghoGBgmDeCZelNwKqlVb1bMMr+zyL1BE0ZnHCRr2U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com; spf=pass smtp.mailfrom=huaweicloud.com; arc=none smtp.client-ip=14.137.139.23 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huaweicloud.com Received: from mail.maildlp.com (unknown [172.18.186.29]) by frasgout11.his.huawei.com (SkyGuard) with ESMTP id 4V5cPT0MfBz9xqwd; Fri, 29 Mar 2024 18:40:29 +0800 (CST) Received: from mail02.huawei.com (unknown [7.182.16.27]) by mail.maildlp.com (Postfix) with ESMTP id 8E05A14068E; Fri, 29 Mar 2024 18:56:32 +0800 (CST) Received: from huaweicloud.com (unknown [10.204.63.22]) by APP2 (Coremail) with SMTP id GxC2BwDnISZMngZmVsAqBQ--.12203S3; Fri, 29 Mar 2024 11:56:31 +0100 (CET) From: Roberto Sassu To: zohar@linux.ibm.com, dmitry.kasatkin@gmail.com, eric.snowberg@oracle.com, paul@paul-moore.com, jmorris@namei.org, serge@hallyn.com Cc: linux-integrity@vger.kernel.org, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-cifs@vger.kernel.org, viro@zeniv.linux.org.uk, pc@manguebit.com, christian@brauner.io, Roberto Sassu , stable@vger.kernel.org Subject: [PATCH 2/2] ima: evm: Rename *_post_path_mknod() to *_path_post_mknod() Date: Fri, 29 Mar 2024 11:56:09 +0100 Message-Id: <20240329105609.1566309-2-roberto.sassu@huaweicloud.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240329105609.1566309-1-roberto.sassu@huaweicloud.com> References: <20240329105609.1566309-1-roberto.sassu@huaweicloud.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID:GxC2BwDnISZMngZmVsAqBQ--.12203S3 X-Coremail-Antispam: 1UD129KBjvJXoWxCF18Gr1ktr15Aw45GFW5trb_yoW5urykpa n5t3WUGrn8JFy5Wr1kAFy7ZFyFg34rXFWUWan5Kw1SyF9xtr1qqFn29a4Y9FZ8tFW0gry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rename ima_post_path_mknod() and evm_post_path_mknod() respectively to ima_path_post_mknod() and evm_path_post_mknod(), to facilitate finding users of the path_post_mknod LSM hook. Cc: stable@vger.kernel.org # 6.8.x Reported-by: Christian Brauner Closes: https://lore.kernel.org/linux-kernel/20240328-raushalten-krass-cb040068bde9@brauner/ Fixes: 05d1a717ec04 ("ima: add support for creating files using the mknodat syscall") Fixes: cd3cec0a02c7 ("ima: Move to LSM infrastructure") Signed-off-by: Roberto Sassu --- security/integrity/evm/evm_main.c | 4 ++-- security/integrity/ima/ima_main.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/security/integrity/evm/evm_main.c b/security/integrity/evm/evm_main.c index ec1659273fcf..b4dd6e960203 100644 --- a/security/integrity/evm/evm_main.c +++ b/security/integrity/evm/evm_main.c @@ -1034,7 +1034,7 @@ static void evm_file_release(struct file *file) iint->flags &= ~EVM_NEW_FILE; } -static void evm_post_path_mknod(struct mnt_idmap *idmap, struct dentry *dentry) +static void evm_path_post_mknod(struct mnt_idmap *idmap, struct dentry *dentry) { struct inode *inode = d_backing_inode(dentry); struct evm_iint_cache *iint; @@ -1102,7 +1102,7 @@ static struct security_hook_list evm_hooks[] __ro_after_init = { LSM_HOOK_INIT(inode_init_security, evm_inode_init_security), LSM_HOOK_INIT(inode_alloc_security, evm_inode_alloc_security), LSM_HOOK_INIT(file_release, evm_file_release), - LSM_HOOK_INIT(path_post_mknod, evm_post_path_mknod), + LSM_HOOK_INIT(path_post_mknod, evm_path_post_mknod), }; static const struct lsm_id evm_lsmid = { diff --git a/security/integrity/ima/ima_main.c b/security/integrity/ima/ima_main.c index afc883e60cf3..f33124ceece3 100644 --- a/security/integrity/ima/ima_main.c +++ b/security/integrity/ima/ima_main.c @@ -709,14 +709,14 @@ static void ima_post_create_tmpfile(struct mnt_idmap *idmap, } /** - * ima_post_path_mknod - mark as a new inode + * ima_path_post_mknod - mark as a new inode * @idmap: idmap of the mount the inode was found from * @dentry: newly created dentry * * Mark files created via the mknodat syscall as new, so that the * file data can be written later. */ -static void ima_post_path_mknod(struct mnt_idmap *idmap, struct dentry *dentry) +static void ima_path_post_mknod(struct mnt_idmap *idmap, struct dentry *dentry) { struct ima_iint_cache *iint; struct inode *inode = d_backing_inode(dentry); @@ -1165,7 +1165,7 @@ static struct security_hook_list ima_hooks[] __ro_after_init = { LSM_HOOK_INIT(kernel_post_load_data, ima_post_load_data), LSM_HOOK_INIT(kernel_read_file, ima_read_file), LSM_HOOK_INIT(kernel_post_read_file, ima_post_read_file), - LSM_HOOK_INIT(path_post_mknod, ima_post_path_mknod), + LSM_HOOK_INIT(path_post_mknod, ima_path_post_mknod), #ifdef CONFIG_IMA_MEASURE_ASYMMETRIC_KEYS LSM_HOOK_INIT(key_post_create_or_update, ima_post_key_create_or_update), #endif -- 2.34.1