linux-security-module.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Casey Schaufler <casey@schaufler-ca.com>
To: John Johansen <john.johansen@canonical.com>,
	jmorris@namei.org, linux-security-module@vger.kernel.org,
	serge@hallyn.com
Cc: Casey Schaufler <casey@schaufler-ca.com>
Subject: Re: WARNING in apparmor_cred_free
Date: Fri, 11 Jan 2019 17:48:24 -0800	[thread overview]
Message-ID: <546a62d3-29a9-f8cf-09f7-ab760b50dc19@schaufler-ca.com> (raw)
In-Reply-To: <234c868b-4521-0707-a135-d8c24bc179bd@schaufler-ca.com>

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>
---
 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;
 }
 
-- 
2.20.1



  parent reply	other threads:[~2019-01-12  1:48 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 [this message]
2019-01-16 23:30           ` James Morris
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=546a62d3-29a9-f8cf-09f7-ab760b50dc19@schaufler-ca.com \
    --to=casey@schaufler-ca.com \
    --cc=jmorris@namei.org \
    --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).