[apparmor] [PATCH 03/15] apparmor: fix profile lookup for unconfined

Jamie Strandboge jamie at canonical.com
Thu Jul 12 19:45:11 UTC 2012


On Thu, 2012-07-12 at 12:04 -0700, John Johansen wrote:
> 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 at canonical.com>
> ---
>  security/apparmor/policy.c |    4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/security/apparmor/policy.c b/security/apparmor/policy.c
> index cf5fd22..aa4f64f 100644
> --- a/security/apparmor/policy.c
> +++ b/security/apparmor/policy.c
> @@ -907,6 +907,10 @@ struct aa_profile *aa_lookup_profile(struct aa_namespace *ns, const char *hname)
>  	if (!profile && strcmp(hname, "unconfined") == 0)
>  		profile = aa_get_profile(ns->unconfined);
>  
> +	/* 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;
>  }
> -- 
> 1.7.9.5
> 

Unless I am blind, isn't the code added here identical to the 2 lines of
context before them?

-- 
Jamie Strandboge             | http://www.canonical.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
URL: <https://lists.ubuntu.com/archives/apparmor/attachments/20120712/c76f45e0/attachment.pgp>


More information about the AppArmor mailing list