X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=kernel%2Fsecurity%2Fapparmor%2Fdomain.c;fp=kernel%2Fsecurity%2Fapparmor%2Fdomain.c;h=53426a6ee6dc535478e49d8a9a7f666447aa7e44;hb=52f993b8e89487ec9ee15a7fb4979e0f09a45b27;hp=dc0027b28b049fa86b83543e2ce0a0640e591c89;hpb=c189ccac5702322ed843fe17057035b7222a59b6;p=kvmfornfv.git 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;