WARNING in apparmor_cred_free

James Morris jmorris at namei.org
Wed Jan 16 23:30:01 UTC 2019


On Fri, 11 Jan 2019, Casey Schaufler wrote:

> >From 1a2a99f3cfd069baf9aa0ef91529558bcbe64c14 Mon Sep 17 00:00:00 2001
> From: Casey Schaufler <casey at schaufler-ca.com>
> Date: Fri, 11 Jan 2019 17:37:56 -0800
> Subject: [PATCH 2/2] AppArmor: Fix credential blob assertions
> 
> The assertions for NULL credential blobs don't take blob
> offsetting into account. Check the raw data, not th eoffset value.
> 
> Signed-off-by: Casey Schaufler <casey at schaufler-ca.com>

JJ: can you ack this if it loogs good to you?

> ---
>  security/apparmor/include/cred.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/security/apparmor/include/cred.h b/security/apparmor/include/cred.h
> index b9504a05fddc..29cef1b5687c 100644
> --- a/security/apparmor/include/cred.h
> +++ b/security/apparmor/include/cred.h
> @@ -27,7 +27,7 @@ static inline struct aa_label *cred_label(const struct cred *cred)
>  {
>  	struct aa_label **blob = cred->security + apparmor_blob_sizes.lbs_cred;
>  
> -	AA_BUG(!blob);
> +	AA_BUG(!cred->security);
>  	return *blob;
>  }
>  
> @@ -36,7 +36,7 @@ static inline void set_cred_label(const struct cred *cred,
>  {
>  	struct aa_label **blob = cred->security + apparmor_blob_sizes.lbs_cred;
>  
> -	AA_BUG(!blob);
> +	AA_BUG(!cred->security);
>  	*blob = label;
>  }
>  
> 

-- 
James Morris
<jmorris at namei.org>



More information about the Linux-security-module-archive mailing list