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 22bb4f24f071..8d528f9930da 100644 --- a/kernel/audit.c +++ b/kernel/audit.c | |||
@@ -1883,6 +1883,23 @@ out_null: | |||
1883 | audit_log_format(ab, " exe=(null)"); | 1883 | audit_log_format(ab, " exe=(null)"); |
1884 | } | 1884 | } |
1885 | 1885 | ||
1886 | struct tty_struct *audit_get_tty(struct task_struct *tsk) | ||
1887 | { | ||
1888 | struct tty_struct *tty = NULL; | ||
1889 | unsigned long flags; | ||
1890 | |||
1891 | spin_lock_irqsave(&tsk->sighand->siglock, flags); | ||
1892 | if (tsk->signal) | ||
1893 | tty = tty_kref_get(tsk->signal->tty); | ||
1894 | spin_unlock_irqrestore(&tsk->sighand->siglock, flags); | ||
1895 | return tty; | ||
1896 | } | ||
1897 | |||
1898 | void audit_put_tty(struct tty_struct *tty) | ||
1899 | { | ||
1900 | tty_kref_put(tty); | ||
1901 | } | ||
1902 | |||
1886 | void audit_log_task_info(struct audit_buffer *ab, struct task_struct *tsk) | 1903 | void audit_log_task_info(struct audit_buffer *ab, struct task_struct *tsk) |
1887 | { | 1904 | { |
1888 | const struct cred *cred; | 1905 | const struct cred *cred; |