Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\audit_tree.c Create Date:2022-07-28 11:30:45
Last Modify:2022-05-22 16:43:11 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:alled with audit_filter_mutex

Proto:int audit_add_tree_rule(struct audit_krule *rule)

Type:int

Parameter:

TypeParameterName
struct audit_krule *rule
806  seed = associated watched tree
811  associated watched tree = NULL
813  If Not strcmp(pathname, pathname) Then
814  put_tree(seed)
815  associated watched tree = tree
816  list_add - add a new entry*@new: new entry to be added*@head: list head to add it after* Insert a new entry after the specified head.* This is good for implementing stacks.
817  Return 0
820  tree = seed
821  list_add - add a new entry*@new: new entry to be added*@head: list head to add it after* Insert a new entry after the specified head.* This is good for implementing stacks.
822  list_add - add a new entry*@new: new entry to be added*@head: list head to add it after* Insert a new entry after the specified head.* This is good for implementing stacks.
824  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
826  If Value for the false possibility is greater at compile time(!prune_thread) Then
827  err = audit_launch_prune()
828  If err Then Go to Err
832  err = kern_path(pathname, 0, & path)
833  If err Then Go to Err
835  mnt = collect_mounts( & path)
836  path_put( & path)
837  If IS_ERR(mnt) Then
838  err = PTR_ERR(mnt)
839  Go to Err
842  get_tree(tree)
843  err = iterate_mounts(tag_mount, tree, mnt)
844  drop_collected_mounts(mnt)
846  If Not err Then
848  spin_lock( & hash_lock)
849  list_for_each_entry - iterate over list of given type*@pos: the type * to use as a loop cursor.*@head: the head for your list.*@member: the name of the list_head within the struct.(node, & chunks, list)
850  index; upper bit indicates 'will prune' &= ~(1U << 31)
851  spin_unlock( & hash_lock)
852  Else
853  rim the uncommitted chunks from tree
854  Go to Err
857  mutex_lock( & audit_filter_mutex)
858  If list_empty - tests whether a list is empty*@head: the list to test. Then
859  put_tree(tree)
860  Return -ENOENT
862  associated watched tree = tree
863  put_tree(tree)
865  Return 0
866  Err :
867  mutex_lock( & audit_filter_mutex)
868  list_del_init - deletes entry from list and reinitialize it.*@entry: the element to delete from the list.
869  list_del_init - deletes entry from list and reinitialize it.*@entry: the element to delete from the list.
870  put_tree(tree)
871  Return err
Caller
NameDescribe
audit_add_ruleAdd rule to given filterlist if not a duplicate.