Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:smk_write_revoke_subj - write() for /smack/revoke-subject*@file: file pointer*@buf: data from user space*@count: bytes sent*@ppos: where to start - must be 0

Proto:static ssize_t smk_write_revoke_subj(struct file *file, const char __user *buf, size_t count, loff_t *ppos)

Type:ssize_t

Parameter:

TypeParameterName
struct file *file
const char __user *buf
size_tcount
loff_t *ppos
2494  rc = count
2496  If ppos != 0 Then Return -EINVAL
2499  If Not smack_privileged - are all privilege requirements met*@cap: The requested capability* Is the task privileged and allowed to be privileged* by the onlycap rule.* Returns true if the task is allowed to be privileged, false if it's not. Then Return -EPERM
2502  If count == 0 || count > SMK_LONGLABEL Then Return -EINVAL
2505  data = memdup_user - duplicate memory region from user space*@src: source address in user space*@len: number of bytes to copy* Return: an ERR_PTR() on failure. Result is physically* contiguous, to be freed by kfree().
2506  If IS_ERR(data) Then Return PTR_ERR(data)
2509  cp = smk_parse_smack - parse smack label from a text string*@string: a text string that might contain a Smack label*@len: the maximum size, or zero if it is NULL terminated.* Returns a pointer to the clean label or an error code.
2510  If IS_ERR(cp) Then
2511  rc = PTR_ERR(cp)
2512  Go to out_data
2515  skp = smk_find_entry - find a label on the list, return the list entry*@string: a text string that might be a Smack label* Returns a pointer to the entry in the label list that* matches the passed string or NULL if not found.
2516  If (skp == NULL) Then Go to out_cp
2519  rule_list = access rules
2520  rule_lock = lock for rules
2522  mutex_lock(rule_lock)
2524  list_for_each_entry_rcu - iterate over rcu 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.(sp, rule_list, list)
2525  smk_access = 0
2527  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.
2529  out_cp :
2530  kfree(cp)
2531  out_data :
2532  kfree(data)
2534  Return rc