diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-11-21 18:27:41 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-11-21 18:27:41 -0500 |
| commit | 3b404a519815b9820f73f1ecf404e5546c9270ba (patch) | |
| tree | aaa2975ab06a0f6f24bf21906577f5f065c48d98 | |
| parent | 8d1a2408efa6a5e75f4c968351a240425c3fa0e5 (diff) | |
| parent | 3d40658c977769ce2138f286cf131537bf68bdfe (diff) | |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security
Pull apparmor bugfix from James Morris:
"This has a fix for a policy replacement bug that is fairly serious for
apache mod_apparmor users, as it results in the wrong policy being
applied on an network facing service"
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security:
apparmor: fix change_hat not finding hat after policy replacement
| -rw-r--r-- | security/apparmor/domain.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/security/apparmor/domain.c b/security/apparmor/domain.c index fc3036b34e51..a4d90aa1045a 100644 --- a/security/apparmor/domain.c +++ b/security/apparmor/domain.c | |||
| @@ -621,8 +621,8 @@ int aa_change_hat(const char *hats[], int count, u64 token, bool permtest) | |||
| 621 | /* released below */ | 621 | /* released below */ |
| 622 | cred = get_current_cred(); | 622 | cred = get_current_cred(); |
| 623 | cxt = cred_cxt(cred); | 623 | cxt = cred_cxt(cred); |
| 624 | profile = aa_cred_profile(cred); | 624 | profile = aa_get_newest_profile(aa_cred_profile(cred)); |
| 625 | previous_profile = cxt->previous; | 625 | previous_profile = aa_get_newest_profile(cxt->previous); |
| 626 | 626 | ||
| 627 | if (unconfined(profile)) { | 627 | if (unconfined(profile)) { |
| 628 | info = "unconfined"; | 628 | info = "unconfined"; |
| @@ -718,6 +718,8 @@ audit: | |||
| 718 | out: | 718 | out: |
| 719 | aa_put_profile(hat); | 719 | aa_put_profile(hat); |
| 720 | kfree(name); | 720 | kfree(name); |
| 721 | aa_put_profile(profile); | ||
| 722 | aa_put_profile(previous_profile); | ||
| 721 | put_cred(cred); | 723 | put_cred(cred); |
| 722 | 724 | ||
| 723 | return error; | 725 | return error; |
