Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\auditfilter.c Create Date:2022-07-28 11:25:16
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Add rule to given filterlist if not a duplicate.

Proto:static inline int audit_add_rule(struct audit_entry *entry)

Type:int

Parameter:

TypeParameterName
struct audit_entry *entry
933  watch = associated watch
934  tree = associated watched tree
936  err = 0
949  mutex_lock( & audit_filter_mutex)
950  e = Find an existing audit rule.* Caller must hold audit_filter_mutex to prevent stale rule data.
951  If e Then
952  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.
953  err = -EEXIST
955  If tree Then audit_put_tree(tree)
957  Return err
960  If watch Then
962  err = audit_add_watch( & rule, & list)
963  If err Then
969  If tree Then audit_put_tree(tree)
971  Return err
974  If tree Then
975  err = audit_add_tree_rule( & rule)
976  If err Then
978  Return err
982  prio = ~0ULL
983  If listnr == Apply rule at syscall exit Then
984  If flags & Prepend to front of list Then prio = ++prio_high
986  Else prio = --prio_low
990  If flags & Prepend to front of list Then
991  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.
993  list_add_rcu - add a new entry to rcu-protected list*@new: new entry to be added*@head: list head to add it after* Insert a new entry after the specified head
994  flags &= ~Prepend to front of list
995  Else
996  list_add_tail - add a new entry*@new: new entry to be added*@head: list head to add it before* Insert a new entry before the specified head.* This is useful for implementing queues.
998  list_add_tail_rcu - add a new entry to rcu-protected list*@new: new entry to be added*@head: list head to add it before* Insert a new entry before the specified head
1007  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.
1009  Return err
Caller
NameDescribe
audit_rule_changeaudit_rule_change - apply all rules to the specified message type*@type: audit message type*@seq: netlink audit message sequence (serial) number*@data: payload data*@datasz: size of payload data