linux-security-module.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: James Morris <jmorris@namei.org>
To: Casey Schaufler <casey@schaufler-ca.com>
Cc: John Johansen <john.johansen@canonical.com>,
	linux-security-module@vger.kernel.org, serge@hallyn.com
Subject: Re: WARNING in apparmor_cred_free
Date: Thu, 17 Jan 2019 10:30:01 +1100 (AEDT)	[thread overview]
Message-ID: <alpine.LRH.2.21.1901171029450.15082@namei.org> (raw)
In-Reply-To: <546a62d3-29a9-f8cf-09f7-ab760b50dc19@schaufler-ca.com>

On Fri, 11 Jan 2019, Casey Schaufler wrote:

> >From 1a2a99f3cfd069baf9aa0ef91529558bcbe64c14 Mon Sep 17 00:00:00 2001
> From: Casey Schaufler <casey@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@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@namei.org>


  reply	other threads:[~2019-01-16 23:30 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-11  9:43 WARNING in apparmor_cred_free syzbot
2019-01-11 22:11 ` Casey Schaufler
2019-01-11 22:30   ` John Johansen
2019-01-11 22:43     ` Casey Schaufler
2019-01-11 23:20       ` Casey Schaufler
2019-01-12  1:46         ` Casey Schaufler
2019-01-14 11:12           ` Dmitry Vyukov
2019-01-16 21:14           ` James Morris
2019-01-16 22:36             ` John Johansen
2019-01-16 23:44           ` James Morris
2019-01-12  1:48         ` Casey Schaufler
2019-01-16 23:30           ` James Morris [this message]
2019-01-17  0:19           ` John Johansen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LRH.2.21.1901171029450.15082@namei.org \
    --to=jmorris@namei.org \
    --cc=casey@schaufler-ca.com \
    --cc=john.johansen@canonical.com \
    --cc=linux-security-module@vger.kernel.org \
    --cc=serge@hallyn.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).