From: Dan Carpenter <dan.carpenter@oracle.com>
To: linux-security-module@vger.kernel.org
Subject: [PATCH] apparmor: signedness bug in aa_xattrs_match()
Date: Mon, 19 Mar 2018 10:34:44 +0000 [thread overview]
Message-ID: <20180319103444.GC8543@mwanda> (raw)
The "size" variable needs to be signed ssize_t so that the error
handling works correctly.
Fixes: 8e51f9087f40 ("apparmor: Add support for attaching profiles via xattr, presence and value")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/security/apparmor/domain.c b/security/apparmor/domain.c
index 57cc892e05a2..590b7e8cd21c 100644
--- a/security/apparmor/domain.c
+++ b/security/apparmor/domain.c
@@ -314,7 +314,7 @@ static int aa_xattrs_match(const struct linux_binprm *bprm,
struct aa_profile *profile, unsigned int state)
{
int i;
- size_t size;
+ ssize_t size;
struct dentry *d;
char *value = NULL;
int value_size = 0, ret = profile->xattr_count;
WARNING: multiple messages have this Message-ID (diff)
From: dan.carpenter@oracle.com (Dan Carpenter)
To: linux-security-module@vger.kernel.org
Subject: [PATCH] apparmor: signedness bug in aa_xattrs_match()
Date: Mon, 19 Mar 2018 13:34:44 +0300 [thread overview]
Message-ID: <20180319103444.GC8543@mwanda> (raw)
The "size" variable needs to be signed ssize_t so that the error
handling works correctly.
Fixes: 8e51f9087f40 ("apparmor: Add support for attaching profiles via xattr, presence and value")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/security/apparmor/domain.c b/security/apparmor/domain.c
index 57cc892e05a2..590b7e8cd21c 100644
--- a/security/apparmor/domain.c
+++ b/security/apparmor/domain.c
@@ -314,7 +314,7 @@ static int aa_xattrs_match(const struct linux_binprm *bprm,
struct aa_profile *profile, unsigned int state)
{
int i;
- size_t size;
+ ssize_t size;
struct dentry *d;
char *value = NULL;
int value_size = 0, ret = profile->xattr_count;
--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next reply other threads:[~2018-03-19 10:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-19 10:34 Dan Carpenter [this message]
2018-03-19 10:34 ` [PATCH] apparmor: signedness bug in aa_xattrs_match() Dan Carpenter
2018-03-24 0:42 ` John Johansen
2018-03-24 0:42 ` 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=20180319103444.GC8543@mwanda \
--to=dan.carpenter@oracle.com \
--cc=linux-security-module@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.