aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/tty_io.c
diff options
context:
space:
mode:
authorAl Viro <viro@ZenIV.linux.org.uk>2008-12-09 04:23:33 -0500
committerJames Morris <jmorris@namei.org>2008-12-09 04:32:06 -0500
commit1e641743f055f075ed9a4edd75f1fb1e05669ddc (patch)
tree8016113a4965a344415e8bd6366f07c23eee7d5f /drivers/char/tty_io.c
parent94d6a5f7341ebaff53d4e41cc81fab37f0d9fbed (diff)
Audit: Log TIOCSTI
AUDIT_TTY records currently log all data read by processes marked for TTY input auditing, even if the data was "pushed back" using the TIOCSTI ioctl, not typed by the user. This patch records all TIOCSTI calls to disambiguate the input. It generates one audit message per character pushed back; considering TIOCSTI is used very rarely, this simple solution is probably good enough. (The only program I could find that uses TIOCSTI is mailx/nail in "header editing" mode, e.g. using the ~h escape. mailx is used very rarely, and the escapes are used even rarer.) Signed-Off-By: Miloslav Trmac <mitr@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'drivers/char/tty_io.c')
-rw-r--r--drivers/char/tty_io.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c
index 1412a8d1e58d..db15f9ba7c0b 100644
--- a/drivers/char/tty_io.c
+++ b/drivers/char/tty_io.c
@@ -2018,6 +2018,7 @@ static int tiocsti(struct tty_struct *tty, char __user *p)
2018 return -EPERM; 2018 return -EPERM;
2019 if (get_user(ch, p)) 2019 if (get_user(ch, p))
2020 return -EFAULT; 2020 return -EFAULT;
2021 tty_audit_tiocsti(tty, ch);
2021 ld = tty_ldisc_ref_wait(tty); 2022 ld = tty_ldisc_ref_wait(tty);
2022 ld->ops->receive_buf(tty, &ch, &mbz, 1); 2023 ld->ops->receive_buf(tty, &ch, &mbz, 1);
2023 tty_ldisc_deref(ld); 2024 tty_ldisc_deref(ld);