Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:smk_write_direct - write() for /smack/direct*@file: file pointer, not actually used*@buf: where to get the data from*@count: bytes sent*@ppos: where to start* Returns number of bytes written or error code, as appropriate

Proto:static ssize_t smk_write_direct(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
1646  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
1649  If count >= size of temp || count == 0 Then Return -EINVAL
1652  If copy_from_user(temp, buf, count) != 0 Then Return -EFAULT
1655  temp[count] = '\0'
1657  If sscanf - Unformat a buffer into a list of arguments*@buf: input buffer*@fmt: formatting of buffer*@...: resulting arguments != 1 Then Return -EINVAL
1665  If This is the level in a CIPSO header that indicates a* smack label is contained directly in the category set.* It can be reset via smackfs/direct != i Then
1666  mutex_lock( & smack_known_lock)
1667  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.(skp, & smack_known_list, list)
1668  If lvl == This is the level in a CIPSO header that indicates a* smack label is contained directly in the category set.* It can be reset via smackfs/direct Then lvl = i
1671  This is the level in a CIPSO header that indicates a* smack label is contained directly in the category set.* It can be reset via smackfs/direct = i
1672  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.
1675  Return count