mirror of
https://github.com/torvalds/linux.git
synced 2026-07-28 01:55:51 +02:00
apparmor: free rawdata as soon as possible
profiles can be pinned by file and other references, and can live long after they have been replaced/removed. The rawdata however is no longer needed, and can be freed earlier than the rest of the profile. Reviewed-by: Georgia Garcia <georgia.garcia@canonical.com> Signed-off-by: John Johansen <john.johansen@canonical.com>
This commit is contained in:
parent
32e92764d6
commit
b9b864fc72
|
|
@ -232,6 +232,13 @@ static void __remove_profile(struct aa_profile *profile)
|
|||
aa_label_remove(&profile->label);
|
||||
__aafs_profile_rmdir(profile);
|
||||
__list_remove_profile(profile);
|
||||
/* rawdata is only ever referenced by fs lookup, that is no
|
||||
* longer possible here, so put the reference to it. This will
|
||||
* enable the rawdata to be freed if for some reason the profile
|
||||
* is pinned and going to live for a while.
|
||||
*/
|
||||
aa_put_profile_loaddata(profile->rawdata);
|
||||
profile->rawdata = NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user