diff options
author | Colin Ian King <colin.king@canonical.com> | 2018-03-23 19:34:22 -0400 |
---|---|---|
committer | John Johansen <john.johansen@canonical.com> | 2018-03-23 20:25:25 -0400 |
commit | a61ecd329cfa951b7d36c13e9e2a07e7761c0e89 (patch) | |
tree | c92710e501d822e36598c816887a5fca2bb11c21 | |
parent | e540c3c901934e23e5eaa9adec8aba1af317220c (diff) |
apparmor: fix error returns checks by making size a ssize_t
Currently variable size is a unsigned size_t, hence comparisons to
see if it is less than zero (for error checking) will always be
false. Fix this by making size a ssize_t
Detected by CoverityScan, CID#1466080 ("Unsigned compared against 0")
Fixes: 8e51f9087f40 ("apparmor: Add support for attaching profiles via xattr, presence and value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
-rw-r--r-- | security/apparmor/domain.c | 2 |
1 files changed, 1 insertions, 1 deletions
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, | |||
314 | struct aa_profile *profile, unsigned int state) | 314 | struct aa_profile *profile, unsigned int state) |
315 | { | 315 | { |
316 | int i; | 316 | int i; |
317 | size_t size; | 317 | ssize_t size; |
318 | struct dentry *d; | 318 | struct dentry *d; |
319 | char *value = NULL; | 319 | char *value = NULL; |
320 | int value_size = 0, ret = profile->xattr_count; | 320 | int value_size = 0, ret = profile->xattr_count; |