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>
This commit is contained in:
parent
f17c366274
commit
82b5c93a00
|
@ -130,19 +130,13 @@ void tty_audit_fork(struct signal_struct *sig)
|
||||||
*/
|
*/
|
||||||
void tty_audit_tiocsti(struct tty_struct *tty, char ch)
|
void tty_audit_tiocsti(struct tty_struct *tty, char ch)
|
||||||
{
|
{
|
||||||
struct tty_audit_buf *buf;
|
|
||||||
dev_t dev;
|
dev_t dev;
|
||||||
|
|
||||||
dev = MKDEV(tty->driver->major, tty->driver->minor_start) + tty->index;
|
dev = MKDEV(tty->driver->major, tty->driver->minor_start) + tty->index;
|
||||||
buf = current->signal->tty_audit_buf;
|
if (tty_audit_push())
|
||||||
if (buf) {
|
return;
|
||||||
mutex_lock(&buf->mutex);
|
|
||||||
if (buf->dev == dev)
|
|
||||||
tty_audit_buf_push(buf);
|
|
||||||
mutex_unlock(&buf->mutex);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (audit_enabled && (current->signal->audit_tty & AUDIT_TTY_ENABLE)) {
|
if (audit_enabled) {
|
||||||
kuid_t auid;
|
kuid_t auid;
|
||||||
unsigned int sessionid;
|
unsigned int sessionid;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue