diff options
Diffstat (limited to 'kernel/security/apparmor')
-rw-r--r-- | kernel/security/apparmor/apparmorfs.c | 1 | ||||
-rw-r--r-- | kernel/security/apparmor/domain.c | 6 |
2 files changed, 5 insertions, 2 deletions
diff --git a/kernel/security/apparmor/apparmorfs.c b/kernel/security/apparmor/apparmorfs.c index ad4fa49ad..9068369f8 100644 --- a/kernel/security/apparmor/apparmorfs.c +++ b/kernel/security/apparmor/apparmorfs.c @@ -331,6 +331,7 @@ static int aa_fs_seq_hash_show(struct seq_file *seq, void *v) seq_printf(seq, "%.2x", profile->hash[i]); seq_puts(seq, "\n"); } + aa_put_profile(profile); return 0; } diff --git a/kernel/security/apparmor/domain.c b/kernel/security/apparmor/domain.c index dc0027b28..53426a6ee 100644 --- a/kernel/security/apparmor/domain.c +++ b/kernel/security/apparmor/domain.c @@ -623,8 +623,8 @@ int aa_change_hat(const char *hats[], int count, u64 token, bool permtest) /* released below */ cred = get_current_cred(); cxt = cred_cxt(cred); - profile = aa_cred_profile(cred); - previous_profile = cxt->previous; + profile = aa_get_newest_profile(aa_cred_profile(cred)); + previous_profile = aa_get_newest_profile(cxt->previous); if (unconfined(profile)) { info = "unconfined"; @@ -720,6 +720,8 @@ audit: out: aa_put_profile(hat); kfree(name); + aa_put_profile(profile); + aa_put_profile(previous_profile); put_cred(cred); return error; |