2 #include <linux/fsnotify_backend.h>
3 #include <linux/namei.h>
4 #include <linux/mount.h>
5 #include <linux/kthread.h>
6 #include <linux/slab.h>
14 struct audit_chunk
*root
;
15 struct list_head chunks
;
16 struct list_head rules
;
17 struct list_head list
;
18 struct list_head same_root
;
24 struct list_head hash
;
25 struct fsnotify_mark_entry mark
;
26 struct list_head trees
; /* with root here */
32 struct list_head list
;
33 struct audit_tree
*owner
;
34 unsigned index
; /* index; upper bit indicates 'will prune' */
38 static LIST_HEAD(tree_list
);
39 static LIST_HEAD(prune_list
);
42 * One struct chunk is attached to each inode of interest.
43 * We replace struct chunk on tagging/untagging.
44 * Rules have pointer to struct audit_tree.
45 * Rules have struct list_head rlist forming a list of rules over
47 * References to struct chunk are collected at audit_inode{,_child}()
48 * time and used in AUDIT_TREE rule matching.
49 * These references are dropped at the same time we are calling
50 * audit_free_names(), etc.
52 * Cyclic lists galore:
53 * tree.chunks anchors chunk.owners[].list hash_lock
54 * tree.rules anchors rule.rlist audit_filter_mutex
55 * chunk.trees anchors tree.same_root hash_lock
56 * chunk.hash is a hash with middle bits of watch.inode as
57 * a hash function. RCU, hash_lock
59 * tree is refcounted; one reference for "some rules on rules_list refer to
60 * it", one for each chunk with pointer to it.
62 * chunk is refcounted by embedded fsnotify_mark + .refs (non-zero refcount
63 * of watch contributes 1 to .refs).
65 * node.index allows to get from node.list to containing chunk.
66 * MSB of that sucker is stolen to mark taggings that we might have to
67 * revert - several operations have very unpleasant cleanup logics and
68 * that makes a difference. Some.
71 static struct fsnotify_group
*audit_tree_group
;
73 static struct audit_tree
*alloc_tree(const char *s
)
75 struct audit_tree
*tree
;
77 tree
= kmalloc(sizeof(struct audit_tree
) + strlen(s
) + 1, GFP_KERNEL
);
79 atomic_set(&tree
->count
, 1);
81 INIT_LIST_HEAD(&tree
->chunks
);
82 INIT_LIST_HEAD(&tree
->rules
);
83 INIT_LIST_HEAD(&tree
->list
);
84 INIT_LIST_HEAD(&tree
->same_root
);
86 strcpy(tree
->pathname
, s
);
91 static inline void get_tree(struct audit_tree
*tree
)
93 atomic_inc(&tree
->count
);
96 static void __put_tree(struct rcu_head
*rcu
)
98 struct audit_tree
*tree
= container_of(rcu
, struct audit_tree
, head
);
102 static inline void put_tree(struct audit_tree
*tree
)
104 if (atomic_dec_and_test(&tree
->count
))
105 call_rcu(&tree
->head
, __put_tree
);
108 /* to avoid bringing the entire thing in audit.h */
109 const char *audit_tree_path(struct audit_tree
*tree
)
111 return tree
->pathname
;
114 static void free_chunk(struct audit_chunk
*chunk
)
118 for (i
= 0; i
< chunk
->count
; i
++) {
119 if (chunk
->owners
[i
].owner
)
120 put_tree(chunk
->owners
[i
].owner
);
125 void audit_put_chunk(struct audit_chunk
*chunk
)
127 if (atomic_long_dec_and_test(&chunk
->refs
))
131 static void __put_chunk(struct rcu_head
*rcu
)
133 struct audit_chunk
*chunk
= container_of(rcu
, struct audit_chunk
, head
);
134 audit_put_chunk(chunk
);
137 static void audit_tree_destroy_watch(struct fsnotify_mark_entry
*entry
)
139 struct audit_chunk
*chunk
= container_of(entry
, struct audit_chunk
, mark
);
140 call_rcu(&chunk
->head
, __put_chunk
);
143 static struct audit_chunk
*alloc_chunk(int count
)
145 struct audit_chunk
*chunk
;
149 size
= offsetof(struct audit_chunk
, owners
) + count
* sizeof(struct node
);
150 chunk
= kzalloc(size
, GFP_KERNEL
);
154 INIT_LIST_HEAD(&chunk
->hash
);
155 INIT_LIST_HEAD(&chunk
->trees
);
156 chunk
->count
= count
;
157 atomic_long_set(&chunk
->refs
, 1);
158 for (i
= 0; i
< count
; i
++) {
159 INIT_LIST_HEAD(&chunk
->owners
[i
].list
);
160 chunk
->owners
[i
].index
= i
;
162 fsnotify_init_mark(&chunk
->mark
, audit_tree_destroy_watch
);
166 enum {HASH_SIZE
= 128};
167 static struct list_head chunk_hash_heads
[HASH_SIZE
];
168 static __cacheline_aligned_in_smp
DEFINE_SPINLOCK(hash_lock
);
170 static inline struct list_head
*chunk_hash(const struct inode
*inode
)
172 unsigned long n
= (unsigned long)inode
/ L1_CACHE_BYTES
;
173 return chunk_hash_heads
+ n
% HASH_SIZE
;
176 /* hash_lock & entry->lock is held by caller */
177 static void insert_hash(struct audit_chunk
*chunk
)
179 struct fsnotify_mark_entry
*entry
= &chunk
->mark
;
180 struct list_head
*list
;
184 list
= chunk_hash(entry
->i
.inode
);
185 list_add_rcu(&chunk
->hash
, list
);
188 /* called under rcu_read_lock */
189 struct audit_chunk
*audit_tree_lookup(const struct inode
*inode
)
191 struct list_head
*list
= chunk_hash(inode
);
192 struct audit_chunk
*p
;
194 list_for_each_entry_rcu(p
, list
, hash
) {
195 /* mark.inode may have gone NULL, but who cares? */
196 if (p
->mark
.i
.inode
== inode
) {
197 atomic_long_inc(&p
->refs
);
204 int audit_tree_match(struct audit_chunk
*chunk
, struct audit_tree
*tree
)
207 for (n
= 0; n
< chunk
->count
; n
++)
208 if (chunk
->owners
[n
].owner
== tree
)
213 /* tagging and untagging inodes with trees */
215 static struct audit_chunk
*find_chunk(struct node
*p
)
217 int index
= p
->index
& ~(1U<<31);
219 return container_of(p
, struct audit_chunk
, owners
[0]);
222 static void untag_chunk(struct node
*p
)
224 struct audit_chunk
*chunk
= find_chunk(p
);
225 struct fsnotify_mark_entry
*entry
= &chunk
->mark
;
226 struct audit_chunk
*new;
227 struct audit_tree
*owner
;
228 int size
= chunk
->count
- 1;
231 fsnotify_get_mark(entry
);
233 spin_unlock(&hash_lock
);
235 spin_lock(&entry
->lock
);
236 if (chunk
->dead
|| !entry
->i
.inode
) {
237 spin_unlock(&entry
->lock
);
245 spin_lock(&hash_lock
);
246 list_del_init(&chunk
->trees
);
247 if (owner
->root
== chunk
)
249 list_del_init(&p
->list
);
250 list_del_rcu(&chunk
->hash
);
251 spin_unlock(&hash_lock
);
252 spin_unlock(&entry
->lock
);
253 fsnotify_destroy_mark_by_entry(entry
);
254 fsnotify_put_mark(entry
);
258 new = alloc_chunk(size
);
261 fsnotify_duplicate_mark(&new->mark
, entry
);
262 if (fsnotify_add_mark(&new->mark
, new->mark
.group
, new->mark
.i
.inode
, 1)) {
268 spin_lock(&hash_lock
);
269 list_replace_init(&chunk
->trees
, &new->trees
);
270 if (owner
->root
== chunk
) {
271 list_del_init(&owner
->same_root
);
275 for (i
= j
= 0; j
<= size
; i
++, j
++) {
276 struct audit_tree
*s
;
277 if (&chunk
->owners
[j
] == p
) {
278 list_del_init(&p
->list
);
282 s
= chunk
->owners
[j
].owner
;
283 new->owners
[i
].owner
= s
;
284 new->owners
[i
].index
= chunk
->owners
[j
].index
- j
+ i
;
285 if (!s
) /* result of earlier fallback */
288 list_replace_init(&chunk
->owners
[j
].list
, &new->owners
[i
].list
);
291 list_replace_rcu(&chunk
->hash
, &new->hash
);
292 list_for_each_entry(owner
, &new->trees
, same_root
)
294 spin_unlock(&hash_lock
);
295 spin_unlock(&entry
->lock
);
296 fsnotify_destroy_mark_by_entry(entry
);
297 fsnotify_put_mark(entry
);
301 // do the best we can
302 spin_lock(&hash_lock
);
303 if (owner
->root
== chunk
) {
304 list_del_init(&owner
->same_root
);
307 list_del_init(&p
->list
);
310 spin_unlock(&hash_lock
);
311 spin_unlock(&entry
->lock
);
313 fsnotify_put_mark(entry
);
314 spin_lock(&hash_lock
);
317 static int create_chunk(struct inode
*inode
, struct audit_tree
*tree
)
319 struct fsnotify_mark_entry
*entry
;
320 struct audit_chunk
*chunk
= alloc_chunk(1);
324 entry
= &chunk
->mark
;
325 if (fsnotify_add_mark(entry
, audit_tree_group
, inode
, 0)) {
330 spin_lock(&entry
->lock
);
331 spin_lock(&hash_lock
);
333 spin_unlock(&hash_lock
);
335 spin_unlock(&entry
->lock
);
336 fsnotify_destroy_mark_by_entry(entry
);
337 fsnotify_put_mark(entry
);
340 chunk
->owners
[0].index
= (1U << 31);
341 chunk
->owners
[0].owner
= tree
;
343 list_add(&chunk
->owners
[0].list
, &tree
->chunks
);
346 list_add(&tree
->same_root
, &chunk
->trees
);
349 spin_unlock(&hash_lock
);
350 spin_unlock(&entry
->lock
);
354 /* the first tagged inode becomes root of tree */
355 static int tag_chunk(struct inode
*inode
, struct audit_tree
*tree
)
357 struct fsnotify_mark_entry
*old_entry
, *chunk_entry
;
358 struct audit_tree
*owner
;
359 struct audit_chunk
*chunk
, *old
;
363 spin_lock(&inode
->i_lock
);
364 old_entry
= fsnotify_find_mark_entry(audit_tree_group
, inode
);
365 spin_unlock(&inode
->i_lock
);
367 return create_chunk(inode
, tree
);
369 old
= container_of(old_entry
, struct audit_chunk
, mark
);
371 /* are we already there? */
372 spin_lock(&hash_lock
);
373 for (n
= 0; n
< old
->count
; n
++) {
374 if (old
->owners
[n
].owner
== tree
) {
375 spin_unlock(&hash_lock
);
376 fsnotify_put_mark(old_entry
);
380 spin_unlock(&hash_lock
);
382 chunk
= alloc_chunk(old
->count
+ 1);
384 fsnotify_put_mark(old_entry
);
388 chunk_entry
= &chunk
->mark
;
390 spin_lock(&old_entry
->lock
);
391 if (!old_entry
->i
.inode
) {
392 /* old_entry is being shot, lets just lie */
393 spin_unlock(&old_entry
->lock
);
394 fsnotify_put_mark(old_entry
);
399 fsnotify_duplicate_mark(chunk_entry
, old_entry
);
400 if (fsnotify_add_mark(chunk_entry
, chunk_entry
->group
, chunk_entry
->i
.inode
, 1)) {
401 spin_unlock(&old_entry
->lock
);
403 fsnotify_put_mark(old_entry
);
407 /* even though we hold old_entry->lock, this is safe since chunk_entry->lock could NEVER have been grabbed before */
408 spin_lock(&chunk_entry
->lock
);
409 spin_lock(&hash_lock
);
411 /* we now hold old_entry->lock, chunk_entry->lock, and hash_lock */
413 spin_unlock(&hash_lock
);
415 spin_unlock(&chunk_entry
->lock
);
416 spin_unlock(&old_entry
->lock
);
418 fsnotify_destroy_mark_by_entry(chunk_entry
);
420 fsnotify_put_mark(chunk_entry
);
421 fsnotify_put_mark(old_entry
);
424 list_replace_init(&old
->trees
, &chunk
->trees
);
425 for (n
= 0, p
= chunk
->owners
; n
< old
->count
; n
++, p
++) {
426 struct audit_tree
*s
= old
->owners
[n
].owner
;
428 p
->index
= old
->owners
[n
].index
;
429 if (!s
) /* result of fallback in untag */
432 list_replace_init(&old
->owners
[n
].list
, &p
->list
);
434 p
->index
= (chunk
->count
- 1) | (1U<<31);
437 list_add(&p
->list
, &tree
->chunks
);
438 list_replace_rcu(&old
->hash
, &chunk
->hash
);
439 list_for_each_entry(owner
, &chunk
->trees
, same_root
)
444 list_add(&tree
->same_root
, &chunk
->trees
);
446 spin_unlock(&hash_lock
);
447 spin_unlock(&chunk_entry
->lock
);
448 spin_unlock(&old_entry
->lock
);
449 fsnotify_destroy_mark_by_entry(old_entry
);
450 fsnotify_put_mark(old_entry
); /* pair to fsnotify_find mark_entry */
451 fsnotify_put_mark(old_entry
); /* and kill it */
455 static void kill_rules(struct audit_tree
*tree
)
457 struct audit_krule
*rule
, *next
;
458 struct audit_entry
*entry
;
459 struct audit_buffer
*ab
;
461 list_for_each_entry_safe(rule
, next
, &tree
->rules
, rlist
) {
462 entry
= container_of(rule
, struct audit_entry
, rule
);
464 list_del_init(&rule
->rlist
);
466 /* not a half-baked one */
467 ab
= audit_log_start(NULL
, GFP_KERNEL
, AUDIT_CONFIG_CHANGE
);
468 audit_log_format(ab
, "op=");
469 audit_log_string(ab
, "remove rule");
470 audit_log_format(ab
, " dir=");
471 audit_log_untrustedstring(ab
, rule
->tree
->pathname
);
472 audit_log_key(ab
, rule
->filterkey
);
473 audit_log_format(ab
, " list=%d res=1", rule
->listnr
);
476 list_del_rcu(&entry
->list
);
477 list_del(&entry
->rule
.list
);
478 call_rcu(&entry
->rcu
, audit_free_rule_rcu
);
484 * finish killing struct audit_tree
486 static void prune_one(struct audit_tree
*victim
)
488 spin_lock(&hash_lock
);
489 while (!list_empty(&victim
->chunks
)) {
492 p
= list_entry(victim
->chunks
.next
, struct node
, list
);
496 spin_unlock(&hash_lock
);
500 /* trim the uncommitted chunks from tree */
502 static void trim_marked(struct audit_tree
*tree
)
504 struct list_head
*p
, *q
;
505 spin_lock(&hash_lock
);
507 spin_unlock(&hash_lock
);
511 for (p
= tree
->chunks
.next
; p
!= &tree
->chunks
; p
= q
) {
512 struct node
*node
= list_entry(p
, struct node
, list
);
514 if (node
->index
& (1U<<31)) {
516 list_add(p
, &tree
->chunks
);
520 while (!list_empty(&tree
->chunks
)) {
523 node
= list_entry(tree
->chunks
.next
, struct node
, list
);
525 /* have we run out of marked? */
526 if (!(node
->index
& (1U<<31)))
531 if (!tree
->root
&& !tree
->goner
) {
533 spin_unlock(&hash_lock
);
534 mutex_lock(&audit_filter_mutex
);
536 list_del_init(&tree
->list
);
537 mutex_unlock(&audit_filter_mutex
);
540 spin_unlock(&hash_lock
);
544 static void audit_schedule_prune(void);
546 /* called with audit_filter_mutex */
547 int audit_remove_tree_rule(struct audit_krule
*rule
)
549 struct audit_tree
*tree
;
552 spin_lock(&hash_lock
);
553 list_del_init(&rule
->rlist
);
554 if (list_empty(&tree
->rules
) && !tree
->goner
) {
556 list_del_init(&tree
->same_root
);
558 list_move(&tree
->list
, &prune_list
);
560 spin_unlock(&hash_lock
);
561 audit_schedule_prune();
565 spin_unlock(&hash_lock
);
571 static int compare_root(struct vfsmount
*mnt
, void *arg
)
573 return mnt
->mnt_root
->d_inode
== arg
;
576 void audit_trim_trees(void)
578 struct list_head cursor
;
580 mutex_lock(&audit_filter_mutex
);
581 list_add(&cursor
, &tree_list
);
582 while (cursor
.next
!= &tree_list
) {
583 struct audit_tree
*tree
;
585 struct vfsmount
*root_mnt
;
589 tree
= container_of(cursor
.next
, struct audit_tree
, list
);
592 list_add(&cursor
, &tree
->list
);
593 mutex_unlock(&audit_filter_mutex
);
595 err
= kern_path(tree
->pathname
, 0, &path
);
599 root_mnt
= collect_mounts(&path
);
604 spin_lock(&hash_lock
);
605 list_for_each_entry(node
, &tree
->chunks
, list
) {
606 struct audit_chunk
*chunk
= find_chunk(node
);
607 /* this could be NULL if the watch is dieing else where... */
608 struct inode
*inode
= chunk
->mark
.i
.inode
;
609 node
->index
|= 1U<<31;
610 if (iterate_mounts(compare_root
, inode
, root_mnt
))
611 node
->index
&= ~(1U<<31);
613 spin_unlock(&hash_lock
);
616 drop_collected_mounts(root_mnt
);
618 mutex_lock(&audit_filter_mutex
);
621 mutex_unlock(&audit_filter_mutex
);
624 int audit_make_tree(struct audit_krule
*rule
, char *pathname
, u32 op
)
627 if (pathname
[0] != '/' ||
628 rule
->listnr
!= AUDIT_FILTER_EXIT
||
630 rule
->inode_f
|| rule
->watch
|| rule
->tree
)
632 rule
->tree
= alloc_tree(pathname
);
638 void audit_put_tree(struct audit_tree
*tree
)
643 static int tag_mount(struct vfsmount
*mnt
, void *arg
)
645 return tag_chunk(mnt
->mnt_root
->d_inode
, arg
);
648 /* called with audit_filter_mutex */
649 int audit_add_tree_rule(struct audit_krule
*rule
)
651 struct audit_tree
*seed
= rule
->tree
, *tree
;
653 struct vfsmount
*mnt
;
656 list_for_each_entry(tree
, &tree_list
, list
) {
657 if (!strcmp(seed
->pathname
, tree
->pathname
)) {
660 list_add(&rule
->rlist
, &tree
->rules
);
665 list_add(&tree
->list
, &tree_list
);
666 list_add(&rule
->rlist
, &tree
->rules
);
667 /* do not set rule->tree yet */
668 mutex_unlock(&audit_filter_mutex
);
670 err
= kern_path(tree
->pathname
, 0, &path
);
673 mnt
= collect_mounts(&path
);
681 err
= iterate_mounts(tag_mount
, tree
, mnt
);
682 drop_collected_mounts(mnt
);
686 spin_lock(&hash_lock
);
687 list_for_each_entry(node
, &tree
->chunks
, list
)
688 node
->index
&= ~(1U<<31);
689 spin_unlock(&hash_lock
);
695 mutex_lock(&audit_filter_mutex
);
696 if (list_empty(&rule
->rlist
)) {
705 mutex_lock(&audit_filter_mutex
);
706 list_del_init(&tree
->list
);
707 list_del_init(&tree
->rules
);
712 int audit_tag_tree(char *old
, char *new)
714 struct list_head cursor
, barrier
;
716 struct path path1
, path2
;
717 struct vfsmount
*tagged
;
720 err
= kern_path(new, 0, &path2
);
723 tagged
= collect_mounts(&path2
);
728 err
= kern_path(old
, 0, &path1
);
730 drop_collected_mounts(tagged
);
734 mutex_lock(&audit_filter_mutex
);
735 list_add(&barrier
, &tree_list
);
736 list_add(&cursor
, &barrier
);
738 while (cursor
.next
!= &tree_list
) {
739 struct audit_tree
*tree
;
742 tree
= container_of(cursor
.next
, struct audit_tree
, list
);
745 list_add(&cursor
, &tree
->list
);
746 mutex_unlock(&audit_filter_mutex
);
748 err
= kern_path(tree
->pathname
, 0, &path2
);
750 good_one
= path_is_under(&path1
, &path2
);
756 mutex_lock(&audit_filter_mutex
);
760 failed
= iterate_mounts(tag_mount
, tree
, tagged
);
763 mutex_lock(&audit_filter_mutex
);
767 mutex_lock(&audit_filter_mutex
);
768 spin_lock(&hash_lock
);
770 list_del(&tree
->list
);
771 list_add(&tree
->list
, &tree_list
);
773 spin_unlock(&hash_lock
);
777 while (barrier
.prev
!= &tree_list
) {
778 struct audit_tree
*tree
;
780 tree
= container_of(barrier
.prev
, struct audit_tree
, list
);
782 list_del(&tree
->list
);
783 list_add(&tree
->list
, &barrier
);
784 mutex_unlock(&audit_filter_mutex
);
788 spin_lock(&hash_lock
);
789 list_for_each_entry(node
, &tree
->chunks
, list
)
790 node
->index
&= ~(1U<<31);
791 spin_unlock(&hash_lock
);
797 mutex_lock(&audit_filter_mutex
);
801 mutex_unlock(&audit_filter_mutex
);
803 drop_collected_mounts(tagged
);
808 * That gets run when evict_chunk() ends up needing to kill audit_tree.
809 * Runs from a separate thread.
811 static int prune_tree_thread(void *unused
)
813 mutex_lock(&audit_cmd_mutex
);
814 mutex_lock(&audit_filter_mutex
);
816 while (!list_empty(&prune_list
)) {
817 struct audit_tree
*victim
;
819 victim
= list_entry(prune_list
.next
, struct audit_tree
, list
);
820 list_del_init(&victim
->list
);
822 mutex_unlock(&audit_filter_mutex
);
826 mutex_lock(&audit_filter_mutex
);
829 mutex_unlock(&audit_filter_mutex
);
830 mutex_unlock(&audit_cmd_mutex
);
834 static void audit_schedule_prune(void)
836 kthread_run(prune_tree_thread
, NULL
, "audit_prune_tree");
840 * ... and that one is done if evict_chunk() decides to delay until the end
841 * of syscall. Runs synchronously.
843 void audit_kill_trees(struct list_head
*list
)
845 mutex_lock(&audit_cmd_mutex
);
846 mutex_lock(&audit_filter_mutex
);
848 while (!list_empty(list
)) {
849 struct audit_tree
*victim
;
851 victim
= list_entry(list
->next
, struct audit_tree
, list
);
853 list_del_init(&victim
->list
);
855 mutex_unlock(&audit_filter_mutex
);
859 mutex_lock(&audit_filter_mutex
);
862 mutex_unlock(&audit_filter_mutex
);
863 mutex_unlock(&audit_cmd_mutex
);
867 * Here comes the stuff asynchronous to auditctl operations
870 static void evict_chunk(struct audit_chunk
*chunk
)
872 struct audit_tree
*owner
;
873 struct list_head
*postponed
= audit_killed_trees();
881 mutex_lock(&audit_filter_mutex
);
882 spin_lock(&hash_lock
);
883 while (!list_empty(&chunk
->trees
)) {
884 owner
= list_entry(chunk
->trees
.next
,
885 struct audit_tree
, same_root
);
888 list_del_init(&owner
->same_root
);
889 spin_unlock(&hash_lock
);
892 list_move(&owner
->list
, &prune_list
);
895 list_move(&owner
->list
, postponed
);
897 spin_lock(&hash_lock
);
899 list_del_rcu(&chunk
->hash
);
900 for (n
= 0; n
< chunk
->count
; n
++)
901 list_del_init(&chunk
->owners
[n
].list
);
902 spin_unlock(&hash_lock
);
904 audit_schedule_prune();
905 mutex_unlock(&audit_filter_mutex
);
908 static int audit_tree_handle_event(struct fsnotify_group
*group
, struct fsnotify_event
*event
)
914 static void audit_tree_freeing_mark(struct fsnotify_mark_entry
*entry
, struct fsnotify_group
*group
)
916 struct audit_chunk
*chunk
= container_of(entry
, struct audit_chunk
, mark
);
919 fsnotify_put_mark(entry
);
922 static bool audit_tree_send_event(struct fsnotify_group
*group
, struct inode
*inode
,
923 struct vfsmount
*mnt
, __u32 mask
, void *data
,
929 static const struct fsnotify_ops audit_tree_ops
= {
930 .handle_event
= audit_tree_handle_event
,
931 .should_send_event
= audit_tree_send_event
,
932 .free_group_priv
= NULL
,
933 .free_event_priv
= NULL
,
934 .freeing_mark
= audit_tree_freeing_mark
,
937 static int __init
audit_tree_init(void)
941 audit_tree_group
= fsnotify_alloc_group(&audit_tree_ops
);
942 if (IS_ERR(audit_tree_group
))
943 audit_panic("cannot initialize fsnotify group for rectree watches");
945 for (i
= 0; i
< HASH_SIZE
; i
++)
946 INIT_LIST_HEAD(&chunk_hash_heads
[i
]);
950 __initcall(audit_tree_init
);