apparmor: leverage audit_log_n_untrustedstring() when possible

Make use of the audit_log_n_untrustedstring() function to simplify the
code in aa_label_xaudit().

Signed-off-by: Paul Moore <paul@paul-moore.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
This commit is contained in:
Paul Moore 2026-07-17 17:52:55 -04:00 committed by John Johansen
parent c431011ab6
commit 3693ff45ec

View File

@ -1743,10 +1743,7 @@ void aa_label_xaudit(struct audit_buffer *ab, struct aa_ns *ns,
str = (char *) label->hname;
len = strlen(str);
}
if (audit_string_contains_control(str, len))
audit_log_n_hex(ab, str, len);
else
audit_log_n_string(ab, str, len);
audit_log_n_untrustedstring(ab, str, len);
kfree(name);
}