From: Peter Hurley Date: Sun, 10 Jan 2016 06:55:38 +0000 (-0800) Subject: tty: audit: Always push audit buffer before TIOCSTI X-Git-Tag: v4.14-rc1~3636^2~179 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=82b5c93a00169614a75d5fa3b5974f832a7857c7;p=platform%2Fkernel%2Flinux-rpi.git tty: audit: Always push audit buffer before TIOCSTI The data read from another tty may be relevant to the action of the TIOCSTI ioctl; log the audit buffer immediately. Signed-off-by: Peter Hurley Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/tty/tty_audit.c b/drivers/tty/tty_audit.c index 269e41f..fa461dc 100644 --- a/drivers/tty/tty_audit.c +++ b/drivers/tty/tty_audit.c @@ -130,19 +130,13 @@ void tty_audit_fork(struct signal_struct *sig) */ void tty_audit_tiocsti(struct tty_struct *tty, char ch) { - struct tty_audit_buf *buf; dev_t dev; dev = MKDEV(tty->driver->major, tty->driver->minor_start) + tty->index; - buf = current->signal->tty_audit_buf; - if (buf) { - mutex_lock(&buf->mutex); - if (buf->dev == dev) - tty_audit_buf_push(buf); - mutex_unlock(&buf->mutex); - } + if (tty_audit_push()) + return; - if (audit_enabled && (current->signal->audit_tty & AUDIT_TTY_ENABLE)) { + if (audit_enabled) { kuid_t auid; unsigned int sessionid;