From patchwork Wed Jun 21 14:46:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 13287476 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 094E6EB64D7 for ; Wed, 21 Jun 2023 14:56:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232383AbjFUO4C (ORCPT ); Wed, 21 Jun 2023 10:56:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58222 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232841AbjFUOx4 (ORCPT ); Wed, 21 Jun 2023 10:53:56 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 29DA6213C; Wed, 21 Jun 2023 07:50:04 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1CFF1615C3; Wed, 21 Jun 2023 14:49:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 86FB8C433C0; Wed, 21 Jun 2023 14:49:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687358988; bh=9L7A8/A6LFjcabA1gjfSYeoHiy7VK9nCxB9xPTQPT0U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Mb+pna0LDACr8Gs3OHfYiWOfyO9fFLyB+1ed0LtE3cjVeob0Z64b+z1tNq3zJkQXL 1EKb/gVprD6ec3dfcMjIYJae+Njg1eVQEWSl5Go1mVLO+v1M2+/QRs05KhFeVF6ztA yHu9xCiDpzJSRavYfm7uvpx4F/yxPiNGCjXRvrSg6lBgRYdmcoJOj93+EtUXFvUrqg gEeJXmg/eqMCx+26qe136b56eVBKAEucaBbW7Xf+9ZJ7CkVQ5u7Su+XdTjTyK6Cl0r SzDe1HIsCf68e2wHRAzrsFvmlwEN/f4tG+m+KDQq6eth67GIYWvFyA51t11YY4tpxa 3716NO77xi/Zw== From: Jeff Layton To: Christian Brauner , John Johansen , Paul Moore , James Morris , "Serge E. Hallyn" Cc: Al Viro , Jan Kara , apparmor@lists.ubuntu.com, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 76/79] apparmor: switch to new ctime accessors Date: Wed, 21 Jun 2023 10:46:29 -0400 Message-ID: <20230621144735.55953-75-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230621144735.55953-1-jlayton@kernel.org> References: <20230621144507.55591-1-jlayton@kernel.org> <20230621144735.55953-1-jlayton@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: In later patches, we're going to change how the ctime.tv_nsec field is utilized. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Signed-off-by: Jeff Layton Acked-by: John Johansen --- security/apparmor/apparmorfs.c | 6 +++--- security/apparmor/policy_unpack.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c index 3d0d370d6ffd..8c72a94dd9e3 100644 --- a/security/apparmor/apparmorfs.c +++ b/security/apparmor/apparmorfs.c @@ -226,7 +226,7 @@ static int __aafs_setup_d_inode(struct inode *dir, struct dentry *dentry, inode->i_ino = get_next_ino(); inode->i_mode = mode; - inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_atime = inode->i_mtime = inode_ctime_set_current(inode); inode->i_private = data; if (S_ISDIR(mode)) { inode->i_op = iops ? iops : &simple_dir_inode_operations; @@ -1557,7 +1557,7 @@ void __aafs_profile_migrate_dents(struct aa_profile *old, if (new->dents[i]) { struct inode *inode = d_inode(new->dents[i]); - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_ctime_set_current(inode); } old->dents[i] = NULL; } @@ -2546,7 +2546,7 @@ static int aa_mk_null_file(struct dentry *parent) inode->i_ino = get_next_ino(); inode->i_mode = S_IFCHR | S_IRUGO | S_IWUGO; - inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_atime = inode->i_mtime = inode_ctime_set_current(inode); init_special_inode(inode, S_IFCHR | S_IRUGO | S_IWUGO, MKDEV(MEM_MAJOR, 3)); d_instantiate(dentry, inode); diff --git a/security/apparmor/policy_unpack.c b/security/apparmor/policy_unpack.c index 4c188a44d65c..334d69b118a9 100644 --- a/security/apparmor/policy_unpack.c +++ b/security/apparmor/policy_unpack.c @@ -89,10 +89,10 @@ void __aa_loaddata_update(struct aa_loaddata *data, long revision) struct inode *inode; inode = d_inode(data->dents[AAFS_LOADDATA_DIR]); - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_ctime_set_current(inode); inode = d_inode(data->dents[AAFS_LOADDATA_REVISION]); - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_ctime_set_current(inode); } } From patchwork Wed Jun 21 14:46:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 13287477 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 E1079EB64DD for ; Wed, 21 Jun 2023 14:56:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231437AbjFUO4D (ORCPT ); Wed, 21 Jun 2023 10:56:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34980 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233008AbjFUOx6 (ORCPT ); Wed, 21 Jun 2023 10:53:58 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B542213E; Wed, 21 Jun 2023 07:50:04 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 9474F61539; Wed, 21 Jun 2023 14:49:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3759BC433C0; Wed, 21 Jun 2023 14:49:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687358990; bh=ZvoZjIEuldwlKWZnI9Mxmed4hFt/g32HDEOmUzdJH4c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=I7N/JO0lu4Yj4i43TUis4tlHzDByV5tzoMO+jPEQAs0ArK/U10XS5GR4B/2cC/D37 sXC+VKMTOE+reQNE3XyN0PvmKvQM8A3vXw3/+cUTv48p6R54DDcFelLqG1M9RFE70T gC1Gi3RPeD1HC7BYOLgMm1cAYg1HJJDjUgAQcuzzxvHe92tFHHZevOQzaBv8GLUzYQ ywwuaTl0ATJAX+XqUOmFg6FIbEStDaSFKEhHfZV3Z2kIHR8i+nBbI7H7gXkM2Hm5oK V0+WuTvjpxUFIEKIX0RzUT4x9i8F8V3AuZdVLdkB9V7nqHZHZes7O/EjNdZ/2LtleJ Xn37XaisI05gg== From: Jeff Layton To: Christian Brauner , Paul Moore , James Morris , "Serge E. Hallyn" Cc: Al Viro , Jan Kara , linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 77/79] security: switch to new ctime accessors Date: Wed, 21 Jun 2023 10:46:30 -0400 Message-ID: <20230621144735.55953-76-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230621144735.55953-1-jlayton@kernel.org> References: <20230621144507.55591-1-jlayton@kernel.org> <20230621144735.55953-1-jlayton@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: In later patches, we're going to change how the ctime.tv_nsec field is utilized. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Signed-off-by: Jeff Layton Acked-by: Paul Moore --- security/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/inode.c b/security/inode.c index 6c326939750d..086280390793 100644 --- a/security/inode.c +++ b/security/inode.c @@ -145,7 +145,7 @@ static struct dentry *securityfs_create_dentry(const char *name, umode_t mode, inode->i_ino = get_next_ino(); inode->i_mode = mode; - inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_atime = inode->i_mtime = inode_ctime_set_current(inode); inode->i_private = data; if (S_ISDIR(mode)) { inode->i_op = &simple_dir_inode_operations;