[apparmor] [PATCH 05/16] apparmor: fix update the mtime of the profile file on replacement

Seth Arnold seth.arnold at canonical.com
Wed Apr 27 02:39:35 UTC 2016


On Wed, Apr 20, 2016 at 11:52:47PM -0700, John Johansen wrote:
> Signed-off-by: John Johansen <john.johansen at canonical.com>

Acked-by: Seth Arnold <seth.arnold at canonical.com>

I think this patch should also set i_ctime to match i_mtime -- a quick
check through fs/ showed dozens of examples of both i_mtime and i_ctime
being set together but only a handful of cases where i_ctime wasn't set
within three lines of i_mtime.

Thanks

> ---
>  security/apparmor/apparmorfs.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c
> index ad4fa49..45a6199 100644
> --- a/security/apparmor/apparmorfs.c
> +++ b/security/apparmor/apparmorfs.c
> @@ -379,6 +379,8 @@ void __aa_fs_profile_migrate_dents(struct aa_profile *old,
>  
>  	for (i = 0; i < AAFS_PROF_SIZEOF; i++) {
>  		new->dents[i] = old->dents[i];
> +		if (new->dents[i])
> +			new->dents[i]->d_inode->i_mtime = CURRENT_TIME;
>  		old->dents[i] = NULL;
>  	}
>  }
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: Digital signature
URL: <https://lists.ubuntu.com/archives/apparmor/attachments/20160426/36d7952e/attachment.pgp>


More information about the AppArmor mailing list