diff options
Diffstat (limited to 'kernel/audit.c')
-rw-r--r-- | kernel/audit.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/kernel/audit.c b/kernel/audit.c index 384374a1d232..d5971010e44a 100644 --- a/kernel/audit.c +++ b/kernel/audit.c | |||
@@ -1866,6 +1866,23 @@ out_null: | |||
1866 | audit_log_format(ab, " exe=(null)"); | 1866 | audit_log_format(ab, " exe=(null)"); |
1867 | } | 1867 | } |
1868 | 1868 | ||
1869 | struct tty_struct *audit_get_tty(struct task_struct *tsk) | ||
1870 | { | ||
1871 | struct tty_struct *tty = NULL; | ||
1872 | unsigned long flags; | ||
1873 | |||
1874 | spin_lock_irqsave(&tsk->sighand->siglock, flags); | ||
1875 | if (tsk->signal) | ||
1876 | tty = tty_kref_get(tsk->signal->tty); | ||
1877 | spin_unlock_irqrestore(&tsk->sighand->siglock, flags); | ||
1878 | return tty; | ||
1879 | } | ||
1880 | |||
1881 | void audit_put_tty(struct tty_struct *tty) | ||
1882 | { | ||
1883 | tty_kref_put(tty); | ||
1884 | } | ||
1885 | |||
1869 | void audit_log_task_info(struct audit_buffer *ab, struct task_struct *tsk) | 1886 | void audit_log_task_info(struct audit_buffer *ab, struct task_struct *tsk) |
1870 | { | 1887 | { |
1871 | const struct cred *cred; | 1888 | const struct cred *cred; |