kernel_optimize_test/security/apparmor
Tom Rix 851b622e7b apparmor: fix error check
[ Upstream commit d108370c644b153382632b3e5511ade575c91c86 ]

clang static analysis reports this representative problem:

label.c:1463:16: warning: Assigned value is garbage or undefined
        label->hname = name;
                     ^ ~~~~

In aa_update_label_name(), this the problem block of code

	if (aa_label_acntsxprint(&name, ...) == -1)
		return res;

On failure, aa_label_acntsxprint() has a more complicated return
that just -1.  So check for a negative return.

It was also noted that the aa_label_acntsxprint() main comment refers
to a nonexistent parameter, so clean up the comment.

Fixes: f1bd904175 ("apparmor: add the base fns() for domain labels")
Signed-off-by: Tom Rix <trix@redhat.com>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-11-18 14:04:22 +01:00
..
include mm, treewide: rename kzfree() to kfree_sensitive() 2020-08-07 11:33:22 -07:00
.gitignore
apparmorfs.c Tag summary 2020-06-07 16:04:49 -07:00
audit.c audit: purge audit_log_string from the intra-kernel audit API 2020-07-21 11:12:31 -04:00
capability.c
crypto.c
domain.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
file.c audit: purge audit_log_string from the intra-kernel audit API 2020-07-21 11:12:31 -04:00
ipc.c audit: purge audit_log_string from the intra-kernel audit API 2020-07-21 11:12:31 -04:00
Kconfig Minor fixes for v5.9. 2020-08-11 14:30:36 -07:00
label.c apparmor: fix error check 2021-11-18 14:04:22 +01:00
lib.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
lsm.c Tag summary 2020-06-07 16:04:49 -07:00
Makefile
match.c
mount.c
net.c audit: purge audit_log_string from the intra-kernel audit API 2020-07-21 11:12:31 -04:00
nulldfa.in
path.c
policy_ns.c mm, treewide: rename kzfree() to kfree_sensitive() 2020-08-07 11:33:22 -07:00
policy_unpack_test.c
policy_unpack.c mm, treewide: rename kzfree() to kfree_sensitive() 2020-08-07 11:33:22 -07:00
policy.c mm, treewide: rename kzfree() to kfree_sensitive() 2020-08-07 11:33:22 -07:00
procattr.c
resource.c
secid.c
stacksplitdfa.in
task.c