File tree Expand file tree Collapse file tree 4 files changed +21
-25
lines changed Expand file tree Collapse file tree 4 files changed +21
-25
lines changed Original file line number Diff line number Diff line change 26
26
#include <linux/sched.h>
27
27
#include <linux/ptrace.h>
28
28
#include <uapi/linux/audit.h>
29
- #include <linux/tty.h>
30
29
31
30
#define AUDIT_INO_UNSET ((unsigned long)-1)
32
31
#define AUDIT_DEV_UNSET ((dev_t)-1)
@@ -344,23 +343,6 @@ static inline unsigned int audit_get_sessionid(struct task_struct *tsk)
344
343
return tsk -> sessionid ;
345
344
}
346
345
347
- static inline struct tty_struct * audit_get_tty (struct task_struct * tsk )
348
- {
349
- struct tty_struct * tty = NULL ;
350
- unsigned long flags ;
351
-
352
- spin_lock_irqsave (& tsk -> sighand -> siglock , flags );
353
- if (tsk -> signal )
354
- tty = tty_kref_get (tsk -> signal -> tty );
355
- spin_unlock_irqrestore (& tsk -> sighand -> siglock , flags );
356
- return tty ;
357
- }
358
-
359
- static inline void audit_put_tty (struct tty_struct * tty )
360
- {
361
- tty_kref_put (tty );
362
- }
363
-
364
346
extern void __audit_ipc_obj (struct kern_ipc_perm * ipcp );
365
347
extern void __audit_ipc_set_perm (unsigned long qbytes , uid_t uid , gid_t gid , umode_t mode );
366
348
extern void __audit_bprm (struct linux_binprm * bprm );
@@ -518,12 +500,6 @@ static inline unsigned int audit_get_sessionid(struct task_struct *tsk)
518
500
{
519
501
return -1 ;
520
502
}
521
- static inline struct tty_struct * audit_get_tty (struct task_struct * tsk )
522
- {
523
- return NULL ;
524
- }
525
- static inline void audit_put_tty (struct tty_struct * tty )
526
- { }
527
503
static inline void audit_ipc_obj (struct kern_ipc_perm * ipcp )
528
504
{ }
529
505
static inline void audit_ipc_set_perm (unsigned long qbytes , uid_t uid ,
Original file line number Diff line number Diff line change @@ -1866,6 +1866,23 @@ void audit_log_d_path_exe(struct audit_buffer *ab,
1866
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
1886
void audit_log_task_info (struct audit_buffer * ab , struct task_struct * tsk )
1870
1887
{
1871
1888
const struct cred * cred ;
Original file line number Diff line number Diff line change 23
23
#include <linux/audit.h>
24
24
#include <linux/skbuff.h>
25
25
#include <uapi/linux/mqueue.h>
26
+ #include <linux/tty.h>
26
27
27
28
/* AUDIT_NAMES is the number of slots we reserve in the audit_context
28
29
* for saving names from getname(). If we get more names we will allocate
@@ -262,6 +263,9 @@ extern struct audit_entry *audit_dupe_rule(struct audit_krule *old);
262
263
extern void audit_log_d_path_exe (struct audit_buffer * ab ,
263
264
struct mm_struct * mm );
264
265
266
+ extern struct tty_struct * audit_get_tty (struct task_struct *tsk );
267
+ extern void audit_put_tty (struct tty_struct * tty );
268
+
265
269
/* audit watch functions */
266
270
#ifdef CONFIG_AUDIT_WATCH
267
271
extern void audit_put_watch (struct audit_watch * watch );
Original file line number Diff line number Diff line change 63
63
#include <asm/unistd.h>
64
64
#include <linux/security.h>
65
65
#include <linux/list.h>
66
- #include <linux/tty.h>
67
66
#include <linux/binfmts.h>
68
67
#include <linux/highmem.h>
69
68
#include <linux/syscalls.h>
You can’t perform that action at this time.
0 commit comments