diff options
author | Jeff Layton <jlayton@kernel.org> | 2023-07-05 15:00:32 -0400 |
---|---|---|
committer | Christian Brauner <brauner@kernel.org> | 2023-07-10 10:04:52 +0200 |
commit | 46fc6b35a6743075f5903eda411e4e0f4f0df84b (patch) | |
tree | 739019469fddb9699bf8b21c7daf9438d20a716a /security/apparmor/policy_unpack.c | |
parent | fb91816e403ed10d7d630b11ae3c7516834d0cce (diff) |
apparmor: update ctime whenever the mtime changes on an inode
In general, when updating the mtime on an inode, one must also update
the ctime. Add the missing ctime updates.
Acked-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Message-Id: <20230705190309.579783-5-jlayton@kernel.org>
Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'security/apparmor/policy_unpack.c')
-rw-r--r-- | security/apparmor/policy_unpack.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/security/apparmor/policy_unpack.c b/security/apparmor/policy_unpack.c index 694fb7a09962..ed180722a833 100644 --- a/security/apparmor/policy_unpack.c +++ b/security/apparmor/policy_unpack.c @@ -86,10 +86,13 @@ void __aa_loaddata_update(struct aa_loaddata *data, long revision) data->revision = revision; if ((data->dents[AAFS_LOADDATA_REVISION])) { - d_inode(data->dents[AAFS_LOADDATA_DIR])->i_mtime = - current_time(d_inode(data->dents[AAFS_LOADDATA_DIR])); - d_inode(data->dents[AAFS_LOADDATA_REVISION])->i_mtime = - current_time(d_inode(data->dents[AAFS_LOADDATA_REVISION])); + struct inode *inode; + + inode = d_inode(data->dents[AAFS_LOADDATA_DIR]); + inode->i_mtime = inode->i_ctime = current_time(inode); + + inode = d_inode(data->dents[AAFS_LOADDATA_REVISION]); + inode->i_mtime = inode->i_ctime = current_time(inode); } } |