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 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);
40 static struct task_struct *prune_thread;
43 * One struct chunk is attached to each inode of interest.
44 * We replace struct chunk on tagging/untagging.
45 * Rules have pointer to struct audit_tree.
46 * Rules have struct list_head rlist forming a list of rules over
48 * References to struct chunk are collected at audit_inode{,_child}()
49 * time and used in AUDIT_TREE rule matching.
50 * These references are dropped at the same time we are calling
51 * audit_free_names(), etc.
53 * Cyclic lists galore:
54 * tree.chunks anchors chunk.owners[].list hash_lock
55 * tree.rules anchors rule.rlist audit_filter_mutex
56 * chunk.trees anchors tree.same_root hash_lock
57 * chunk.hash is a hash with middle bits of watch.inode as
58 * a hash function. RCU, hash_lock
60 * tree is refcounted; one reference for "some rules on rules_list refer to
61 * it", one for each chunk with pointer to it.
63 * chunk is refcounted by embedded fsnotify_mark + .refs (non-zero refcount
64 * of watch contributes 1 to .refs).
66 * node.index allows to get from node.list to containing chunk.
67 * MSB of that sucker is stolen to mark taggings that we might have to
68 * revert - several operations have very unpleasant cleanup logics and
69 * that makes a difference. Some.
72 static struct fsnotify_group *audit_tree_group;
74 static struct audit_tree *alloc_tree(const char *s)
76 struct audit_tree *tree;
78 tree = kmalloc(sizeof(struct audit_tree) + strlen(s) + 1, GFP_KERNEL);
80 atomic_set(&tree->count, 1);
82 INIT_LIST_HEAD(&tree->chunks);
83 INIT_LIST_HEAD(&tree->rules);
84 INIT_LIST_HEAD(&tree->list);
85 INIT_LIST_HEAD(&tree->same_root);
87 strcpy(tree->pathname, s);
92 static inline void get_tree(struct audit_tree *tree)
94 atomic_inc(&tree->count);
97 static inline void put_tree(struct audit_tree *tree)
99 if (atomic_dec_and_test(&tree->count))
100 kfree_rcu(tree, head);
103 /* to avoid bringing the entire thing in audit.h */
104 const char *audit_tree_path(struct audit_tree *tree)
106 return tree->pathname;
109 static void free_chunk(struct audit_chunk *chunk)
113 for (i = 0; i < chunk->count; i++) {
114 if (chunk->owners[i].owner)
115 put_tree(chunk->owners[i].owner);
120 void audit_put_chunk(struct audit_chunk *chunk)
122 if (atomic_long_dec_and_test(&chunk->refs))
126 static void __put_chunk(struct rcu_head *rcu)
128 struct audit_chunk *chunk = container_of(rcu, struct audit_chunk, head);
129 audit_put_chunk(chunk);
132 static void audit_tree_destroy_watch(struct fsnotify_mark *entry)
134 struct audit_chunk *chunk = container_of(entry, struct audit_chunk, mark);
135 call_rcu(&chunk->head, __put_chunk);
138 static struct audit_chunk *alloc_chunk(int count)
140 struct audit_chunk *chunk;
144 size = offsetof(struct audit_chunk, owners) + count * sizeof(struct node);
145 chunk = kzalloc(size, GFP_KERNEL);
149 INIT_LIST_HEAD(&chunk->hash);
150 INIT_LIST_HEAD(&chunk->trees);
151 chunk->count = count;
152 atomic_long_set(&chunk->refs, 1);
153 for (i = 0; i < count; i++) {
154 INIT_LIST_HEAD(&chunk->owners[i].list);
155 chunk->owners[i].index = i;
157 fsnotify_init_mark(&chunk->mark, audit_tree_destroy_watch);
158 chunk->mark.mask = FS_IN_IGNORED;
162 enum {HASH_SIZE = 128};
163 static struct list_head chunk_hash_heads[HASH_SIZE];
164 static __cacheline_aligned_in_smp DEFINE_SPINLOCK(hash_lock);
166 /* Function to return search key in our hash from inode. */
167 static unsigned long inode_to_key(const struct inode *inode)
169 return (unsigned long)inode;
173 * Function to return search key in our hash from chunk. Key 0 is special and
174 * should never be present in the hash.
176 static unsigned long chunk_to_key(struct audit_chunk *chunk)
179 * We have a reference to the mark so it should be attached to a
182 if (WARN_ON_ONCE(!chunk->mark.connector))
184 return (unsigned long)chunk->mark.connector->inode;
187 static inline struct list_head *chunk_hash(unsigned long key)
189 unsigned long n = key / L1_CACHE_BYTES;
190 return chunk_hash_heads + n % HASH_SIZE;
193 /* hash_lock & entry->lock is held by caller */
194 static void insert_hash(struct audit_chunk *chunk)
196 unsigned long key = chunk_to_key(chunk);
197 struct list_head *list;
199 if (!(chunk->mark.flags & FSNOTIFY_MARK_FLAG_ATTACHED))
201 list = chunk_hash(key);
202 list_add_rcu(&chunk->hash, list);
205 /* called under rcu_read_lock */
206 struct audit_chunk *audit_tree_lookup(const struct inode *inode)
208 unsigned long key = inode_to_key(inode);
209 struct list_head *list = chunk_hash(key);
210 struct audit_chunk *p;
212 list_for_each_entry_rcu(p, list, hash) {
213 if (chunk_to_key(p) == key) {
214 atomic_long_inc(&p->refs);
221 bool audit_tree_match(struct audit_chunk *chunk, struct audit_tree *tree)
224 for (n = 0; n < chunk->count; n++)
225 if (chunk->owners[n].owner == tree)
230 /* tagging and untagging inodes with trees */
232 static struct audit_chunk *find_chunk(struct node *p)
234 int index = p->index & ~(1U<<31);
236 return container_of(p, struct audit_chunk, owners[0]);
239 static void untag_chunk(struct node *p)
241 struct audit_chunk *chunk = find_chunk(p);
242 struct fsnotify_mark *entry = &chunk->mark;
243 struct audit_chunk *new = NULL;
244 struct audit_tree *owner;
245 int size = chunk->count - 1;
248 fsnotify_get_mark(entry);
250 spin_unlock(&hash_lock);
253 new = alloc_chunk(size);
255 mutex_lock(&entry->group->mark_mutex);
256 spin_lock(&entry->lock);
258 * mark_mutex protects mark from getting detached and thus also from
259 * mark->connector->inode getting NULL.
261 if (chunk->dead || !(entry->flags & FSNOTIFY_MARK_FLAG_ATTACHED)) {
262 spin_unlock(&entry->lock);
263 mutex_unlock(&entry->group->mark_mutex);
273 spin_lock(&hash_lock);
274 list_del_init(&chunk->trees);
275 if (owner->root == chunk)
277 list_del_init(&p->list);
278 list_del_rcu(&chunk->hash);
279 spin_unlock(&hash_lock);
280 spin_unlock(&entry->lock);
281 mutex_unlock(&entry->group->mark_mutex);
282 fsnotify_destroy_mark(entry, audit_tree_group);
289 if (fsnotify_add_mark_locked(&new->mark, entry->group,
290 entry->connector->inode, NULL, 1)) {
291 fsnotify_put_mark(&new->mark);
296 spin_lock(&hash_lock);
297 list_replace_init(&chunk->trees, &new->trees);
298 if (owner->root == chunk) {
299 list_del_init(&owner->same_root);
303 for (i = j = 0; j <= size; i++, j++) {
304 struct audit_tree *s;
305 if (&chunk->owners[j] == p) {
306 list_del_init(&p->list);
310 s = chunk->owners[j].owner;
311 new->owners[i].owner = s;
312 new->owners[i].index = chunk->owners[j].index - j + i;
313 if (!s) /* result of earlier fallback */
316 list_replace_init(&chunk->owners[j].list, &new->owners[i].list);
319 list_replace_rcu(&chunk->hash, &new->hash);
320 list_for_each_entry(owner, &new->trees, same_root)
322 spin_unlock(&hash_lock);
323 spin_unlock(&entry->lock);
324 mutex_unlock(&entry->group->mark_mutex);
325 fsnotify_destroy_mark(entry, audit_tree_group);
326 fsnotify_put_mark(&new->mark); /* drop initial reference */
330 // do the best we can
331 spin_lock(&hash_lock);
332 if (owner->root == chunk) {
333 list_del_init(&owner->same_root);
336 list_del_init(&p->list);
339 spin_unlock(&hash_lock);
340 spin_unlock(&entry->lock);
341 mutex_unlock(&entry->group->mark_mutex);
343 fsnotify_put_mark(entry);
344 spin_lock(&hash_lock);
347 static int create_chunk(struct inode *inode, struct audit_tree *tree)
349 struct fsnotify_mark *entry;
350 struct audit_chunk *chunk = alloc_chunk(1);
354 entry = &chunk->mark;
355 if (fsnotify_add_mark(entry, audit_tree_group, inode, NULL, 0)) {
356 fsnotify_put_mark(entry);
360 spin_lock(&entry->lock);
361 spin_lock(&hash_lock);
363 spin_unlock(&hash_lock);
365 spin_unlock(&entry->lock);
366 fsnotify_destroy_mark(entry, audit_tree_group);
367 fsnotify_put_mark(entry);
370 chunk->owners[0].index = (1U << 31);
371 chunk->owners[0].owner = tree;
373 list_add(&chunk->owners[0].list, &tree->chunks);
376 list_add(&tree->same_root, &chunk->trees);
379 spin_unlock(&hash_lock);
380 spin_unlock(&entry->lock);
381 fsnotify_put_mark(entry); /* drop initial reference */
385 /* the first tagged inode becomes root of tree */
386 static int tag_chunk(struct inode *inode, struct audit_tree *tree)
388 struct fsnotify_mark *old_entry, *chunk_entry;
389 struct audit_tree *owner;
390 struct audit_chunk *chunk, *old;
394 old_entry = fsnotify_find_mark(&inode->i_fsnotify_marks,
397 return create_chunk(inode, tree);
399 old = container_of(old_entry, struct audit_chunk, mark);
401 /* are we already there? */
402 spin_lock(&hash_lock);
403 for (n = 0; n < old->count; n++) {
404 if (old->owners[n].owner == tree) {
405 spin_unlock(&hash_lock);
406 fsnotify_put_mark(old_entry);
410 spin_unlock(&hash_lock);
412 chunk = alloc_chunk(old->count + 1);
414 fsnotify_put_mark(old_entry);
418 chunk_entry = &chunk->mark;
420 mutex_lock(&old_entry->group->mark_mutex);
421 spin_lock(&old_entry->lock);
423 * mark_mutex protects mark from getting detached and thus also from
424 * mark->connector->inode getting NULL.
426 if (!(old_entry->flags & FSNOTIFY_MARK_FLAG_ATTACHED)) {
427 /* old_entry is being shot, lets just lie */
428 spin_unlock(&old_entry->lock);
429 mutex_unlock(&old_entry->group->mark_mutex);
430 fsnotify_put_mark(old_entry);
435 if (fsnotify_add_mark_locked(chunk_entry, old_entry->group,
436 old_entry->connector->inode, NULL, 1)) {
437 spin_unlock(&old_entry->lock);
438 mutex_unlock(&old_entry->group->mark_mutex);
439 fsnotify_put_mark(chunk_entry);
440 fsnotify_put_mark(old_entry);
444 /* even though we hold old_entry->lock, this is safe since chunk_entry->lock could NEVER have been grabbed before */
445 spin_lock(&chunk_entry->lock);
446 spin_lock(&hash_lock);
448 /* we now hold old_entry->lock, chunk_entry->lock, and hash_lock */
450 spin_unlock(&hash_lock);
452 spin_unlock(&chunk_entry->lock);
453 spin_unlock(&old_entry->lock);
454 mutex_unlock(&old_entry->group->mark_mutex);
456 fsnotify_destroy_mark(chunk_entry, audit_tree_group);
458 fsnotify_put_mark(chunk_entry);
459 fsnotify_put_mark(old_entry);
462 list_replace_init(&old->trees, &chunk->trees);
463 for (n = 0, p = chunk->owners; n < old->count; n++, p++) {
464 struct audit_tree *s = old->owners[n].owner;
466 p->index = old->owners[n].index;
467 if (!s) /* result of fallback in untag */
470 list_replace_init(&old->owners[n].list, &p->list);
472 p->index = (chunk->count - 1) | (1U<<31);
475 list_add(&p->list, &tree->chunks);
476 list_replace_rcu(&old->hash, &chunk->hash);
477 list_for_each_entry(owner, &chunk->trees, same_root)
482 list_add(&tree->same_root, &chunk->trees);
484 spin_unlock(&hash_lock);
485 spin_unlock(&chunk_entry->lock);
486 spin_unlock(&old_entry->lock);
487 mutex_unlock(&old_entry->group->mark_mutex);
488 fsnotify_destroy_mark(old_entry, audit_tree_group);
489 fsnotify_put_mark(chunk_entry); /* drop initial reference */
490 fsnotify_put_mark(old_entry); /* pair to fsnotify_find mark_entry */
494 static void audit_tree_log_remove_rule(struct audit_krule *rule)
496 struct audit_buffer *ab;
498 ab = audit_log_start(NULL, GFP_KERNEL, AUDIT_CONFIG_CHANGE);
501 audit_log_format(ab, "op=remove_rule");
502 audit_log_format(ab, " dir=");
503 audit_log_untrustedstring(ab, rule->tree->pathname);
504 audit_log_key(ab, rule->filterkey);
505 audit_log_format(ab, " list=%d res=1", rule->listnr);
509 static void kill_rules(struct audit_tree *tree)
511 struct audit_krule *rule, *next;
512 struct audit_entry *entry;
514 list_for_each_entry_safe(rule, next, &tree->rules, rlist) {
515 entry = container_of(rule, struct audit_entry, rule);
517 list_del_init(&rule->rlist);
519 /* not a half-baked one */
520 audit_tree_log_remove_rule(rule);
522 audit_remove_mark(entry->rule.exe);
524 list_del_rcu(&entry->list);
525 list_del(&entry->rule.list);
526 call_rcu(&entry->rcu, audit_free_rule_rcu);
532 * finish killing struct audit_tree
534 static void prune_one(struct audit_tree *victim)
536 spin_lock(&hash_lock);
537 while (!list_empty(&victim->chunks)) {
540 p = list_entry(victim->chunks.next, struct node, list);
544 spin_unlock(&hash_lock);
548 /* trim the uncommitted chunks from tree */
550 static void trim_marked(struct audit_tree *tree)
552 struct list_head *p, *q;
553 spin_lock(&hash_lock);
555 spin_unlock(&hash_lock);
559 for (p = tree->chunks.next; p != &tree->chunks; p = q) {
560 struct node *node = list_entry(p, struct node, list);
562 if (node->index & (1U<<31)) {
564 list_add(p, &tree->chunks);
568 while (!list_empty(&tree->chunks)) {
571 node = list_entry(tree->chunks.next, struct node, list);
573 /* have we run out of marked? */
574 if (!(node->index & (1U<<31)))
579 if (!tree->root && !tree->goner) {
581 spin_unlock(&hash_lock);
582 mutex_lock(&audit_filter_mutex);
584 list_del_init(&tree->list);
585 mutex_unlock(&audit_filter_mutex);
588 spin_unlock(&hash_lock);
592 static void audit_schedule_prune(void);
594 /* called with audit_filter_mutex */
595 int audit_remove_tree_rule(struct audit_krule *rule)
597 struct audit_tree *tree;
600 spin_lock(&hash_lock);
601 list_del_init(&rule->rlist);
602 if (list_empty(&tree->rules) && !tree->goner) {
604 list_del_init(&tree->same_root);
606 list_move(&tree->list, &prune_list);
608 spin_unlock(&hash_lock);
609 audit_schedule_prune();
613 spin_unlock(&hash_lock);
619 static int compare_root(struct vfsmount *mnt, void *arg)
621 return inode_to_key(d_backing_inode(mnt->mnt_root)) ==
625 void audit_trim_trees(void)
627 struct list_head cursor;
629 mutex_lock(&audit_filter_mutex);
630 list_add(&cursor, &tree_list);
631 while (cursor.next != &tree_list) {
632 struct audit_tree *tree;
634 struct vfsmount *root_mnt;
638 tree = container_of(cursor.next, struct audit_tree, list);
641 list_add(&cursor, &tree->list);
642 mutex_unlock(&audit_filter_mutex);
644 err = kern_path(tree->pathname, 0, &path);
648 root_mnt = collect_mounts(&path);
650 if (IS_ERR(root_mnt))
653 spin_lock(&hash_lock);
654 list_for_each_entry(node, &tree->chunks, list) {
655 struct audit_chunk *chunk = find_chunk(node);
656 /* this could be NULL if the watch is dying else where... */
657 node->index |= 1U<<31;
658 if (iterate_mounts(compare_root,
659 (void *)chunk_to_key(chunk),
661 node->index &= ~(1U<<31);
663 spin_unlock(&hash_lock);
665 drop_collected_mounts(root_mnt);
668 mutex_lock(&audit_filter_mutex);
671 mutex_unlock(&audit_filter_mutex);
674 int audit_make_tree(struct audit_krule *rule, char *pathname, u32 op)
677 if (pathname[0] != '/' ||
678 rule->listnr != AUDIT_FILTER_EXIT ||
680 rule->inode_f || rule->watch || rule->tree)
682 rule->tree = alloc_tree(pathname);
688 void audit_put_tree(struct audit_tree *tree)
693 static int tag_mount(struct vfsmount *mnt, void *arg)
695 return tag_chunk(d_backing_inode(mnt->mnt_root), arg);
699 * That gets run when evict_chunk() ends up needing to kill audit_tree.
700 * Runs from a separate thread.
702 static int prune_tree_thread(void *unused)
705 if (list_empty(&prune_list)) {
706 set_current_state(TASK_INTERRUPTIBLE);
710 mutex_lock(&audit_cmd_mutex);
711 mutex_lock(&audit_filter_mutex);
713 while (!list_empty(&prune_list)) {
714 struct audit_tree *victim;
716 victim = list_entry(prune_list.next,
717 struct audit_tree, list);
718 list_del_init(&victim->list);
720 mutex_unlock(&audit_filter_mutex);
724 mutex_lock(&audit_filter_mutex);
727 mutex_unlock(&audit_filter_mutex);
728 mutex_unlock(&audit_cmd_mutex);
733 static int audit_launch_prune(void)
737 prune_thread = kthread_run(prune_tree_thread, NULL,
739 if (IS_ERR(prune_thread)) {
740 pr_err("cannot start thread audit_prune_tree");
747 /* called with audit_filter_mutex */
748 int audit_add_tree_rule(struct audit_krule *rule)
750 struct audit_tree *seed = rule->tree, *tree;
752 struct vfsmount *mnt;
756 list_for_each_entry(tree, &tree_list, list) {
757 if (!strcmp(seed->pathname, tree->pathname)) {
760 list_add(&rule->rlist, &tree->rules);
765 list_add(&tree->list, &tree_list);
766 list_add(&rule->rlist, &tree->rules);
767 /* do not set rule->tree yet */
768 mutex_unlock(&audit_filter_mutex);
770 if (unlikely(!prune_thread)) {
771 err = audit_launch_prune();
776 err = kern_path(tree->pathname, 0, &path);
779 mnt = collect_mounts(&path);
787 err = iterate_mounts(tag_mount, tree, mnt);
788 drop_collected_mounts(mnt);
792 spin_lock(&hash_lock);
793 list_for_each_entry(node, &tree->chunks, list)
794 node->index &= ~(1U<<31);
795 spin_unlock(&hash_lock);
801 mutex_lock(&audit_filter_mutex);
802 if (list_empty(&rule->rlist)) {
811 mutex_lock(&audit_filter_mutex);
812 list_del_init(&tree->list);
813 list_del_init(&tree->rules);
818 int audit_tag_tree(char *old, char *new)
820 struct list_head cursor, barrier;
822 struct path path1, path2;
823 struct vfsmount *tagged;
826 err = kern_path(new, 0, &path2);
829 tagged = collect_mounts(&path2);
832 return PTR_ERR(tagged);
834 err = kern_path(old, 0, &path1);
836 drop_collected_mounts(tagged);
840 mutex_lock(&audit_filter_mutex);
841 list_add(&barrier, &tree_list);
842 list_add(&cursor, &barrier);
844 while (cursor.next != &tree_list) {
845 struct audit_tree *tree;
848 tree = container_of(cursor.next, struct audit_tree, list);
851 list_add(&cursor, &tree->list);
852 mutex_unlock(&audit_filter_mutex);
854 err = kern_path(tree->pathname, 0, &path2);
856 good_one = path_is_under(&path1, &path2);
862 mutex_lock(&audit_filter_mutex);
866 failed = iterate_mounts(tag_mount, tree, tagged);
869 mutex_lock(&audit_filter_mutex);
873 mutex_lock(&audit_filter_mutex);
874 spin_lock(&hash_lock);
876 list_del(&tree->list);
877 list_add(&tree->list, &tree_list);
879 spin_unlock(&hash_lock);
883 while (barrier.prev != &tree_list) {
884 struct audit_tree *tree;
886 tree = container_of(barrier.prev, struct audit_tree, list);
888 list_del(&tree->list);
889 list_add(&tree->list, &barrier);
890 mutex_unlock(&audit_filter_mutex);
894 spin_lock(&hash_lock);
895 list_for_each_entry(node, &tree->chunks, list)
896 node->index &= ~(1U<<31);
897 spin_unlock(&hash_lock);
903 mutex_lock(&audit_filter_mutex);
907 mutex_unlock(&audit_filter_mutex);
909 drop_collected_mounts(tagged);
914 static void audit_schedule_prune(void)
916 wake_up_process(prune_thread);
920 * ... and that one is done if evict_chunk() decides to delay until the end
921 * of syscall. Runs synchronously.
923 void audit_kill_trees(struct list_head *list)
925 mutex_lock(&audit_cmd_mutex);
926 mutex_lock(&audit_filter_mutex);
928 while (!list_empty(list)) {
929 struct audit_tree *victim;
931 victim = list_entry(list->next, struct audit_tree, list);
933 list_del_init(&victim->list);
935 mutex_unlock(&audit_filter_mutex);
939 mutex_lock(&audit_filter_mutex);
942 mutex_unlock(&audit_filter_mutex);
943 mutex_unlock(&audit_cmd_mutex);
947 * Here comes the stuff asynchronous to auditctl operations
950 static void evict_chunk(struct audit_chunk *chunk)
952 struct audit_tree *owner;
953 struct list_head *postponed = audit_killed_trees();
961 mutex_lock(&audit_filter_mutex);
962 spin_lock(&hash_lock);
963 while (!list_empty(&chunk->trees)) {
964 owner = list_entry(chunk->trees.next,
965 struct audit_tree, same_root);
968 list_del_init(&owner->same_root);
969 spin_unlock(&hash_lock);
972 list_move(&owner->list, &prune_list);
975 list_move(&owner->list, postponed);
977 spin_lock(&hash_lock);
979 list_del_rcu(&chunk->hash);
980 for (n = 0; n < chunk->count; n++)
981 list_del_init(&chunk->owners[n].list);
982 spin_unlock(&hash_lock);
983 mutex_unlock(&audit_filter_mutex);
985 audit_schedule_prune();
988 static int audit_tree_handle_event(struct fsnotify_group *group,
989 struct inode *to_tell,
990 struct fsnotify_mark *inode_mark,
991 struct fsnotify_mark *vfsmount_mark,
992 u32 mask, const void *data, int data_type,
993 const unsigned char *file_name, u32 cookie,
994 struct fsnotify_iter_info *iter_info)
999 static void audit_tree_freeing_mark(struct fsnotify_mark *entry, struct fsnotify_group *group)
1001 struct audit_chunk *chunk = container_of(entry, struct audit_chunk, mark);
1006 * We are guaranteed to have at least one reference to the mark from
1007 * either the inode or the caller of fsnotify_destroy_mark().
1009 BUG_ON(atomic_read(&entry->refcnt) < 1);
1012 static const struct fsnotify_ops audit_tree_ops = {
1013 .handle_event = audit_tree_handle_event,
1014 .freeing_mark = audit_tree_freeing_mark,
1017 static int __init audit_tree_init(void)
1021 audit_tree_group = fsnotify_alloc_group(&audit_tree_ops);
1022 if (IS_ERR(audit_tree_group))
1023 audit_panic("cannot initialize fsnotify group for rectree watches");
1025 for (i = 0; i < HASH_SIZE; i++)
1026 INIT_LIST_HEAD(&chunk_hash_heads[i]);
1030 __initcall(audit_tree_init);