summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Hurley <peter@hurleysoftware.com>2016-01-09 22:55:25 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-01-27 16:41:04 -0800
commitd7c0ba40ebb32510e2c5d80a392474320cab8a2d (patch)
tree93341323f8d4d89868548d5dd69fe25168c716ea
parent4a510969374ab8853451c337e43d28fb864e43fd (diff)
downloadlinux-d7c0ba40ebb32510e2c5d80a392474320cab8a2d.tar.bz2
tty: audit: Early-out pty master reads earlier
Reads from pty masters are not logged; early-out before taking locks. Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/tty/tty_audit.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/tty/tty_audit.c b/drivers/tty/tty_audit.c
index 3d245cd3d8e6..ead924e4bd53 100644
--- a/drivers/tty/tty_audit.c
+++ b/drivers/tty/tty_audit.c
@@ -276,16 +276,16 @@ void tty_audit_add_data(struct tty_struct *tty, const void *data,
if (unlikely(size == 0))
return;
+ if (tty->driver->type == TTY_DRIVER_TYPE_PTY
+ && tty->driver->subtype == PTY_TYPE_MASTER)
+ return;
+
spin_lock_irqsave(&current->sighand->siglock, flags);
audit_log_tty_passwd = current->signal->audit_tty_log_passwd;
spin_unlock_irqrestore(&current->sighand->siglock, flags);
if (!audit_log_tty_passwd && icanon && !L_ECHO(tty))
return;
- if (tty->driver->type == TTY_DRIVER_TYPE_PTY
- && tty->driver->subtype == PTY_TYPE_MASTER)
- return;
-
buf = tty_audit_buf_get(tty, icanon);
if (!buf)
return;