diff options
author | John Johansen <john.johansen@canonical.com> | 2012-05-22 08:22:20 -0700 |
---|---|---|
committer | John Rigby <john.rigby@linaro.org> | 2012-06-24 17:40:03 -0600 |
commit | 8e5775be4295caa69f0150690e9e274dc4db2765 (patch) | |
tree | 78ce79ed29e53e5512f756bfaa610226ae1721f6 /security | |
parent | 61fd6e0385002121af19fa1d3ed65b15525dbee9 (diff) |
UBUNTU: SAUCE: apparmor: fix profile lookup for unconfined
OriginalLocation: security/next bf83208e0b7f5938f5a7f6d9dfa9960bf04692fa
BugLink: http://bugs.launchpad.net/bugs/978038
also affects apparmor portion of
BugLink: http://bugs.launchpad.net/bugs/987371
The unconfined profile is not stored in the regular profile list, but
change_profile and exec transitions may want access to it when setting
up specialized transitions like switch to the unconfined profile of a
new policy namespace.
Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Diffstat (limited to 'security')
-rw-r--r-- | security/apparmor/policy.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/security/apparmor/policy.c b/security/apparmor/policy.c index b8100a7d5cf..39056afec2a 100644 --- a/security/apparmor/policy.c +++ b/security/apparmor/policy.c @@ -904,6 +904,10 @@ struct aa_profile *aa_lookup_profile(struct aa_namespace *ns, const char *hname) profile = aa_get_profile(__lookup_profile(&ns->base, hname)); read_unlock(&ns->lock); + /* the unconfined profile is not in the regular profile list */ + if (!profile && strcmp(hname, "unconfined") == 0) + profile = aa_get_profile(ns->unconfined); + /* refcount released by caller */ return profile; } |