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

tty: audit: Check audit enable first

Audit is unlikely to be enabled; check first to exit asap.
Signed-off-by: default avatarPeter Hurley <peter@hurleysoftware.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent fbaa1227
......@@ -211,6 +211,10 @@ void tty_audit_add_data(struct tty_struct *tty, const void *data, size_t size)
unsigned int audit_tty;
dev_t dev;
audit_tty = READ_ONCE(current->signal->audit_tty);
if (~audit_tty & AUDIT_TTY_ENABLE)
return;
if (unlikely(size == 0))
return;
......@@ -218,9 +222,6 @@ void tty_audit_add_data(struct tty_struct *tty, const void *data, size_t size)
&& tty->driver->subtype == PTY_TYPE_MASTER)
return;
audit_tty = READ_ONCE(current->signal->audit_tty);
if (~audit_tty & AUDIT_TTY_ENABLE)
return;
if ((~audit_tty & AUDIT_TTY_LOG_PASSWD) && icanon && !L_ECHO(tty))
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