Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:smk_set_access - add a rule to the rule list or replace an old rule*@srp: the rule to add or replace*@rule_list: the list of rules*@rule_lock: the rule list lock* Looks through the current subject/object/access list for* the subject/object pair and

Proto:static int smk_set_access(struct smack_parsed_rule *srp, struct list_head *rule_list, struct mutex *rule_lock)

Type:int

Parameter:

TypeParameterName
struct smack_parsed_rule *srp
struct list_head *rule_list
struct mutex *rule_lock
216  found = 0
217  rc = 0
219  mutex_lock(rule_lock)
226  If smk_object == smk_object && smk_subject == smk_subject Then
228  found = 1
229  smk_access |= smk_access1
230  smk_access &= ~smk_access2
231  Break
235  If found == 0 Then
236  sp = Shortcuts
237  If (sp == NULL) Then
238  rc = -ENOMEM
239  Go to out
242  smk_subject = smk_subject
243  smk_object = smk_object
244  smk_access = smk_access1 & ~smk_access2
246  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
249  out :
250  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.
251  Return rc
Caller
NameDescribe
smk_write_rules_listsmk_write_rules_list - write() for any /smack rule file*@file: file pointer, not actually used*@buf: where to get the data from*@count: bytes sent*@ppos: where to start - must be 0*@rule_list: the list of rules to write to*@rule_lock: lock for the rule