From: Miloslav Trmac <mitr@redhat.com>
To: viro <viro@zeniv.linux.org.uk>
Cc: Steve Grubb <sgrubb@redhat.com>, Eric Paris <eparis@redhat.com>,
akpm <akpm@linux-foundation.org>,
linux-kernel <linux-kernel@vger.kernel.org>
Subject: Fwd: [patch for 2.6.27? 1/1] audit: ignore terminating NUL in AUDIT_USER_TTY messages
Date: Thu, 19 Mar 2009 09:52:47 -0400 (EDT) [thread overview]
Message-ID: <1887464454.1703501237470767793.JavaMail.root@zmail07.collab.prod.int.phx2.redhat.com> (raw)
In-Reply-To: <573973171.1703051237470609326.JavaMail.root@zmail07.collab.prod.int.phx2.redhat.com>
[-- 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);
_
parent reply other threads:[~2009-03-19 13:54 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <573973171.1703051237470609326.JavaMail.root@zmail07.collab.prod.int.phx2.redhat.com>]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1887464454.1703501237470767793.JavaMail.root@zmail07.collab.prod.int.phx2.redhat.com \
--to=mitr@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=eparis@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=sgrubb@redhat.com \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®