Skip to content

Commit

Permalink
apparmor: fix profile lookup for unconfined
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
John Johansen committed May 18, 2012
1 parent fbbb456 commit bf83208
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions security/apparmor/policy.c
Original file line number Diff line number Diff line change
Expand Up @@ -903,6 +903,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;
}
Expand Down

0 comments on commit bf83208

Please sign in to comment.