aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/tty_audit.c
diff options
context:
space:
mode:
authorPeter Hurley <peter@hurleysoftware.com>2016-01-09 22:55:38 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-01-27 16:41:04 -0800
commit82b5c93a00169614a75d5fa3b5974f832a7857c7 (patch)
tree267913d9a9ab495b7ee95084e2a1aba6bd746235 /drivers/tty/tty_audit.c
parenttty: audit: Check audit enable first (diff)
downloadlinux-dev-82b5c93a00169614a75d5fa3b5974f832a7857c7.tar.xz
linux-dev-82b5c93a00169614a75d5fa3b5974f832a7857c7.zip
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 <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/tty_audit.c')
-rw-r--r--drivers/tty/tty_audit.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/drivers/tty/tty_audit.c b/drivers/tty/tty_audit.c
index 269e41f45832..fa461dc5b111 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;