Commit 46fc6b35 authored by Jeff Layton's avatar Jeff Layton Committed by Christian Brauner

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: default avatarJohn Johansen <john.johansen@canonical.com>
Signed-off-by: default avatarJeff Layton <jlayton@kernel.org>
Message-Id: <20230705190309.579783-5-jlayton@kernel.org>
Signed-off-by: default avatarChristian Brauner <brauner@kernel.org>
parent fb91816e
...@@ -1554,8 +1554,11 @@ void __aafs_profile_migrate_dents(struct aa_profile *old, ...@@ -1554,8 +1554,11 @@ void __aafs_profile_migrate_dents(struct aa_profile *old,
for (i = 0; i < AAFS_PROF_SIZEOF; i++) { for (i = 0; i < AAFS_PROF_SIZEOF; i++) {
new->dents[i] = old->dents[i]; new->dents[i] = old->dents[i];
if (new->dents[i]) if (new->dents[i]) {
new->dents[i]->d_inode->i_mtime = current_time(new->dents[i]->d_inode); struct inode *inode = d_inode(new->dents[i]);
inode->i_mtime = inode->i_ctime = current_time(inode);
}
old->dents[i] = NULL; old->dents[i] = NULL;
} }
} }
......
...@@ -86,10 +86,13 @@ void __aa_loaddata_update(struct aa_loaddata *data, long revision) ...@@ -86,10 +86,13 @@ void __aa_loaddata_update(struct aa_loaddata *data, long revision)
data->revision = revision; data->revision = revision;
if ((data->dents[AAFS_LOADDATA_REVISION])) { if ((data->dents[AAFS_LOADDATA_REVISION])) {
d_inode(data->dents[AAFS_LOADDATA_DIR])->i_mtime = struct inode *inode;
current_time(d_inode(data->dents[AAFS_LOADDATA_DIR]));
d_inode(data->dents[AAFS_LOADDATA_REVISION])->i_mtime = inode = d_inode(data->dents[AAFS_LOADDATA_DIR]);
current_time(d_inode(data->dents[AAFS_LOADDATA_REVISION])); 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);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment