* [PATCH 2/2] audit: Handle embedded NUL in TTY input auditing
@ 2008-09-10 22:29 Miloslav Trmač
2008-09-11 14:25 ` Eric Paris
0 siblings, 1 reply; 2+ messages in thread
From: Miloslav Trmač @ 2008-09-10 22:29 UTC (permalink / raw)
To: viro, Eric Paris; +Cc: linux-audit, linux-kernel
From: Miloslav Trmac <mitr@redhat.com>
Data read from a TTY can contain an embedded NUL byte (e.g. after
pressing Ctrl-2, or sent to a PTY). After the previous patch, the data
would be logged only up to the first NUL.
This patch modifies the AUDIT_TTY record to always use the hexadecimal
format, which does not terminate at the first NUL byte. The vast
majority of recorded TTY input data will contain either ' ' or '\n', so
the hexadecimal format would have been used anyway.
Signed-off-by: Miloslav Trmac <mitr@redhat.com>
---
tty_audit.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/char/tty_audit.c b/drivers/char/tty_audit.c
index 3582f43..5787249 100644
--- a/drivers/char/tty_audit.c
+++ b/drivers/char/tty_audit.c
@@ -93,7 +93,7 @@ static void tty_audit_buf_push(struct task_struct *tsk, uid_t loginuid,
get_task_comm(name, tsk);
audit_log_untrustedstring(ab, name);
audit_log_format(ab, " data=");
- audit_log_n_untrustedstring(ab, buf->data, buf->valid);
+ audit_log_n_hex(ab, buf->data, buf->valid);
audit_log_end(ab);
}
buf->valid = 0;
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 2/2] audit: Handle embedded NUL in TTY input auditing
2008-09-10 22:29 [PATCH 2/2] audit: Handle embedded NUL in TTY input auditing Miloslav Trmač
@ 2008-09-11 14:25 ` Eric Paris
0 siblings, 0 replies; 2+ messages in thread
From: Eric Paris @ 2008-09-11 14:25 UTC (permalink / raw)
To: Miloslav Trmač; +Cc: viro, linux-audit, linux-kernel
On Thu, 2008-09-11 at 00:29 +0200, Miloslav Trmač wrote:
> From: Miloslav Trmac <mitr@redhat.com>
>
> Data read from a TTY can contain an embedded NUL byte (e.g. after
> pressing Ctrl-2, or sent to a PTY). After the previous patch, the data
> would be logged only up to the first NUL.
>
> This patch modifies the AUDIT_TTY record to always use the hexadecimal
> format, which does not terminate at the first NUL byte. The vast
> majority of recorded TTY input data will contain either ' ' or '\n', so
> the hexadecimal format would have been used anyway.
>
> Signed-off-by: Miloslav Trmac <mitr@redhat.com>
Acked-by: Eric Paris <eparis@redhat.com>
> ---
> tty_audit.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> diff --git a/drivers/char/tty_audit.c b/drivers/char/tty_audit.c
> index 3582f43..5787249 100644
> --- a/drivers/char/tty_audit.c
> +++ b/drivers/char/tty_audit.c
> @@ -93,7 +93,7 @@ static void tty_audit_buf_push(struct task_struct *tsk, uid_t loginuid,
> get_task_comm(name, tsk);
> audit_log_untrustedstring(ab, name);
> audit_log_format(ab, " data=");
> - audit_log_n_untrustedstring(ab, buf->data, buf->valid);
> + audit_log_n_hex(ab, buf->data, buf->valid);
> audit_log_end(ab);
> }
> buf->valid = 0;
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-09-11 14:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-10 22:29 [PATCH 2/2] audit: Handle embedded NUL in TTY input auditing Miloslav Trmač
2008-09-11 14:25 ` Eric Paris
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox