android_kernel_xiaomi_sm7250/security/apparmor
Tom Rix 9f3eb0a8a5 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-26 11:36:14 +01:00
..
include apparmor: fix nnp subset test for unconfined 2020-06-25 15:32:52 +02:00
.gitignore
apparmorfs.c apparmor: remove duplicate macro list_entry_is_head() 2021-09-26 13:39:47 +02:00
audit.c
capability.c
crypto.c
domain.c apparmor: fix nnp subset test for unconfined 2020-06-25 15:32:52 +02:00
file.c
ipc.c
Kconfig
label.c apparmor: fix error check 2021-11-26 11:36:14 +01:00
lib.c
lsm.c apparmor: don't try to replace stale label in ptraceme check 2020-06-30 23:17:03 -04:00
Makefile
match.c apparmor: ensure that dfa state tables have entries 2020-07-22 09:32:06 +02:00
mount.c
net.c
nulldfa.in
path.c
policy_ns.c
policy_unpack.c
policy.c
procattr.c
resource.c
secid.c
stacksplitdfa.in
task.c