aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/audit.h
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/audit.h')
-rw-r--r--kernel/audit.h62
1 files changed, 58 insertions, 4 deletions
diff --git a/kernel/audit.h b/kernel/audit.h
index 6f733920fd32..6aa33b848cf2 100644
--- a/kernel/audit.h
+++ b/kernel/audit.h
@@ -19,9 +19,9 @@
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */ 20 */
21 21
22#include <linux/mutex.h>
23#include <linux/fs.h> 22#include <linux/fs.h>
24#include <linux/audit.h> 23#include <linux/audit.h>
24#include <linux/skbuff.h>
25 25
26/* 0 = no checking 26/* 0 = no checking
27 1 = put_count checking 27 1 = put_count checking
@@ -53,6 +53,18 @@ enum audit_state {
53}; 53};
54 54
55/* Rule lists */ 55/* Rule lists */
56struct audit_parent;
57
58struct audit_watch {
59 atomic_t count; /* reference count */
60 char *path; /* insertion path */
61 dev_t dev; /* associated superblock device */
62 unsigned long ino; /* associated inode number */
63 struct audit_parent *parent; /* associated parent */
64 struct list_head wlist; /* entry in parent->watches list */
65 struct list_head rules; /* associated rules */
66};
67
56struct audit_field { 68struct audit_field {
57 u32 type; 69 u32 type;
58 u32 val; 70 u32 val;
@@ -69,7 +81,11 @@ struct audit_krule {
69 u32 mask[AUDIT_BITMASK_SIZE]; 81 u32 mask[AUDIT_BITMASK_SIZE];
70 u32 buflen; /* for data alloc on list rules */ 82 u32 buflen; /* for data alloc on list rules */
71 u32 field_count; 83 u32 field_count;
84 char *filterkey; /* ties events to rules */
72 struct audit_field *fields; 85 struct audit_field *fields;
86 struct audit_field *inode_f; /* quick access to an inode field */
87 struct audit_watch *watch; /* associated watch */
88 struct list_head rlist; /* entry in audit_watch.rules list */
73}; 89};
74 90
75struct audit_entry { 91struct audit_entry {
@@ -78,15 +94,53 @@ struct audit_entry {
78 struct audit_krule rule; 94 struct audit_krule rule;
79}; 95};
80 96
81
82extern int audit_pid; 97extern int audit_pid;
83extern int audit_comparator(const u32 left, const u32 op, const u32 right);
84 98
99#define AUDIT_INODE_BUCKETS 32
100extern struct list_head audit_inode_hash[AUDIT_INODE_BUCKETS];
101
102static inline int audit_hash_ino(u32 ino)
103{
104 return (ino & (AUDIT_INODE_BUCKETS-1));
105}
106
107extern int audit_comparator(const u32 left, const u32 op, const u32 right);
108extern int audit_compare_dname_path(const char *dname, const char *path,
109 int *dirlen);
110extern struct sk_buff * audit_make_reply(int pid, int seq, int type,
111 int done, int multi,
112 void *payload, int size);
85extern void audit_send_reply(int pid, int seq, int type, 113extern void audit_send_reply(int pid, int seq, int type,
86 int done, int multi, 114 int done, int multi,
87 void *payload, int size); 115 void *payload, int size);
88extern void audit_log_lost(const char *message); 116extern void audit_log_lost(const char *message);
89extern void audit_panic(const char *message); 117extern void audit_panic(const char *message);
90extern struct mutex audit_netlink_mutex;
91 118
119struct audit_netlink_list {
120 int pid;
121 struct sk_buff_head q;
122};
123
124int audit_send_list(void *);
125
126struct inotify_watch;
127extern void audit_free_parent(struct inotify_watch *);
128extern void audit_handle_ievent(struct inotify_watch *, u32, u32, u32,
129 const char *, struct inode *);
92extern int selinux_audit_rule_update(void); 130extern int selinux_audit_rule_update(void);
131
132#ifdef CONFIG_AUDITSYSCALL
133extern void __audit_signal_info(int sig, struct task_struct *t);
134static inline void audit_signal_info(int sig, struct task_struct *t)
135{
136 if (unlikely(audit_pid && t->tgid == audit_pid))
137 __audit_signal_info(sig, t);
138}
139extern enum audit_state audit_filter_inodes(struct task_struct *,
140 struct audit_context *);
141extern void audit_set_auditable(struct audit_context *);
142#else
143#define audit_signal_info(s,t)
144#define audit_filter_inodes(t,c) AUDIT_DISABLED
145#define audit_set_auditable(c)
146#endif