]> git.baikalelectronics.ru Git - kernel.git/commit
apparmor: fix error returns checks by making size a ssize_t
authorColin Ian King <colin.king@canonical.com>
Fri, 23 Mar 2018 23:34:22 +0000 (23:34 +0000)
committerJohn Johansen <john.johansen@canonical.com>
Sat, 24 Mar 2018 00:25:25 +0000 (17:25 -0700)
commite3658cb9164dab379e35e890eb834864f02dfc6e
treec92710e501d822e36598c816887a5fca2bb11c21
parentc6f9c62b794df4f0750b1899ce3a557e0851901c
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: ada1a8786ade ("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>
security/apparmor/domain.c