Skip to content

Commit 45189a1

Browse files
stephensmalleypcmoore
authored andcommitted
selinux: fix avc audit messages
commit a2c5138 ("selinux: inline some AVC functions used only once") introduced usage of audit_log_string() in place of audit_log_format() for fixed strings. However, audit_log_string() quotes the string. This breaks the avc audit message format and userspace audit parsers. Switch back to using audit_log_format(). Fixes: a2c5138 ("selinux: inline some AVC functions used only once") Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov> Signed-off-by: Paul Moore <paul@paul-moore.com>
1 parent e6f2f38 commit 45189a1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

security/selinux/avc.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -674,13 +674,13 @@ static void avc_audit_pre_callback(struct audit_buffer *ab, void *a)
674674
audit_log_format(ab, "avc: %s ", sad->denied ? "denied" : "granted");
675675

676676
if (av == 0) {
677-
audit_log_string(ab, " null");
677+
audit_log_format(ab, " null");
678678
return;
679679
}
680680

681681
perms = secclass_map[sad->tclass-1].perms;
682682

683-
audit_log_string(ab, " {");
683+
audit_log_format(ab, " {");
684684
i = 0;
685685
perm = 1;
686686
while (i < (sizeof(av) * 8)) {
@@ -695,7 +695,7 @@ static void avc_audit_pre_callback(struct audit_buffer *ab, void *a)
695695
if (av)
696696
audit_log_format(ab, " 0x%x", av);
697697

698-
audit_log_string(ab, " } for ");
698+
audit_log_format(ab, " } for ");
699699
}
700700

701701
/**

0 commit comments

Comments
 (0)