Commit d7c0ba40 authored by Peter Hurley's avatar Peter Hurley Committed by Greg Kroah-Hartman

tty: audit: Early-out pty master reads earlier

Reads from pty masters are not logged; early-out before taking
locks.
Signed-off-by: default avatarPeter Hurley <peter@hurleysoftware.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4a510969
...@@ -276,16 +276,16 @@ void tty_audit_add_data(struct tty_struct *tty, const void *data, ...@@ -276,16 +276,16 @@ void tty_audit_add_data(struct tty_struct *tty, const void *data,
if (unlikely(size == 0)) if (unlikely(size == 0))
return; return;
if (tty->driver->type == TTY_DRIVER_TYPE_PTY
&& tty->driver->subtype == PTY_TYPE_MASTER)
return;
spin_lock_irqsave(&current->sighand->siglock, flags); spin_lock_irqsave(&current->sighand->siglock, flags);
audit_log_tty_passwd = current->signal->audit_tty_log_passwd; audit_log_tty_passwd = current->signal->audit_tty_log_passwd;
spin_unlock_irqrestore(&current->sighand->siglock, flags); spin_unlock_irqrestore(&current->sighand->siglock, flags);
if (!audit_log_tty_passwd && icanon && !L_ECHO(tty)) if (!audit_log_tty_passwd && icanon && !L_ECHO(tty))
return; return;
if (tty->driver->type == TTY_DRIVER_TYPE_PTY
&& tty->driver->subtype == PTY_TYPE_MASTER)
return;
buf = tty_audit_buf_get(tty, icanon); buf = tty_audit_buf_get(tty, icanon);
if (!buf) if (!buf)
return; return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment