mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Fwd: [patch for 2.6.27? 1/1] audit: ignore terminating NUL in AUDIT_USER_TTY messages
       [not found] <573973171.1703051237470609326.JavaMail.root@zmail07.collab.prod.int.phx2.redhat.com>
@ 2009-03-19 13:52 ` Miloslav Trmac
  0 siblings, 0 replies; only message in thread
From: Miloslav Trmac @ 2009-03-19 13:52 UTC (permalink / raw)
  To: viro; +Cc: Steve Grubb, Eric Paris, akpm, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 60 bytes --]

Hello,
this appears to have been lost somewhere...
    Mirek

[-- Attachment #2: Type: message/rfc822, Size: 3586 bytes --]

From: akpm@linux-foundation.org
To: viro@zeniv.linux.org.uk
Cc: akpm@linux-foundation.org, mitr@redhat.com, eparis@redhat.com, sgrubb@redhat.com
Subject: [patch for 2.6.27? 1/1] audit: ignore terminating NUL in AUDIT_USER_TTY messages
Date: Mon, 22 Sep 2008 14:05:33 -0700
Message-ID: <200809222105.m8ML5XGb029625@imap1.linux-foundation.org>

From: Miloslav Trmac <mitr@redhat.com>

AUDIT_USER_TTY, like all other messages sent from user-space, is sent
NUL-terminated.  Unlike other user-space audit messages, which come only
from trusted sources, AUDIT_USER_TTY messages are processed using
audit_log_n_untrustedstring().

This patch modifies AUDIT_USER_TTY handling to ignore the trailing NUL
and use the "quoted_string" representation of the message if possible.

Signed-off-by: Miloslav Trmac <mitr@redhat.com>
Cc: Eric Paris <eparis@redhat.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Steve Grubb <sgrubb@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 kernel/audit.c |    3 +++
 1 file changed, 3 insertions(+)

diff -puN kernel/audit.c~audit-ignore-terminating-nul-in-audit_user_tty-messages kernel/audit.c
--- a/kernel/audit.c~audit-ignore-terminating-nul-in-audit_user_tty-messages
+++ a/kernel/audit.c
@@ -763,6 +763,9 @@ static int audit_receive_msg(struct sk_b
 
 				audit_log_format(ab, " msg=");
 				size = nlmsg_len(nlh);
+				if (size > 0 &&
+				    ((unsigned char *)data)[size - 1] == '\0')
+					size--;
 				audit_log_n_untrustedstring(ab, data, size);
 			}
 			audit_set_pid(ab, pid);
_

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-03-19 13:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <573973171.1703051237470609326.JavaMail.root@zmail07.collab.prod.int.phx2.redhat.com>
2009-03-19 13:52 ` Fwd: [patch for 2.6.27? 1/1] audit: ignore terminating NUL in AUDIT_USER_TTY messages Miloslav Trmac

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®