Skip to contentSkip to conversation

Strange audit messages - whitespace

DISCUSSION Steve G 3 participants 3 messages Apr 24, 2005 – Apr 25, 2005

Subsystems (2)
lore
Share & tools
lore

Steve G

author
#0 lore raw
Quoted 3 lines

I get audit messages that look like this (with lots of extra whitespace) for my new GConf domain. Any idea what can cause this?

This sounds like an old kernel bug. There was a patch on the audit mail list that fixes it. It is pending being merged in the mm kernel. It only affects syslog messages. If you use the audit daemon, you won't see the problem.

-Steve Grubb

kernel/audit.c 2005-02-16 13:53:24.757060224 -0500 renamed from kernel/audit.c.orig 2005-02-16 13:49:28.839925080 -0500 +2 -2
@@ -513,8 +513,8 @@
                if (!audit_pid) { /* No daemon */
                        int offset = ab->nlh ? NLMSG_SPACE(0) : 0;
                        int len    = skb->len - offset;
-                       printk(KERN_ERR "%*.*s\n",
-                              len, len, skb->data + offset);
+                       skb->data[offset + len] = '\0';
+                       printk(KERN_ERR "%s\n", skb->data + offset);
                }
                kfree_skb(skb);
                ab->nlh = NULL;

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.

#1 lore raw
Quoted 14 lines · Steve G
Quoted 3 lines

I get audit messages that look like this (with lots of extra whitespace) for my new GConf domain. Any idea what can cause this?

This sounds like an old kernel bug. There was a patch on the audit mail list that fixes it. It is pending being merged in the mm kernel. It only affects syslog messages. If you use the audit daemon, you won't see the problem.

(quoted diff) +0 -1
-Steve Grubb

kernel/audit.c 2005-02-16 13:53:24.757060224 -0500 line 520

Quoted 10 lines
kernel/audit.c 2005-02-16 13:53:24.757060224 -0500 renamed from kernel/audit.c.orig 2005-02-16 13:49:28.839925080 -0500 +2 -2
@@ -513,8 +513,8 @@
                if (!audit_pid) { /* No daemon */
                        int offset = ab->nlh ? NLMSG_SPACE(0) : 0;
                        int len    = skb->len - offset;
-                       printk(KERN_ERR "%*.*s\n",
-                              len, len, skb->data + offset);
+                       skb->data[offset + len] = '\0';
+                       printk(KERN_ERR "%s\n", skb->data + offset);
                }
                kfree_skb(skb);
                ab->nlh = NULL;

Any reason that small bug fixes like this aren't upstreamed immediately rather than waiting on the overall audit patchset?

Although I suppose that the real bug here is in printk's handling of the "%*.*s" format, so either it should not support that format at all or someone needs to find the bug in it and fix it. Also, what does skb-

Quoted 1 line

data[offset+len] contain prior to setting it to the NUL character as

above?

Signature · 8 lines
Stephen Smalley <[email protected]>
National Security Agency


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
#2 lore raw
Quoted 2 lines · * Stephen Smalley ([email protected]) wrote:

Any reason that small bug fixes like this aren't upstreamed immediately rather than waiting on the overall audit patchset?

No good reason. I actually thought it went upstream already. I'll push it.

thanks,
-chris

Signature · 6 lines
Linux Security Modules     http://lsm.immunix.org     http://lsm.bkbits.net

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.