Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:moyo_write_self - write() for /sys/kernel/security/tomoyo/self_domain interface

Proto:static ssize_t tomoyo_write_self(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
47  If Not count || count >= TOMOYO_EXEC_TMPSIZE - 10 Then Return -ENOMEM
49  data = memdup_user_nul - duplicate memory region from user space and NUL-terminate*@src: source address in user space*@len: number of bytes to copy* Return: an ERR_PTR() on failure.
50  If IS_ERR(data) Then Return PTR_ERR(data)
52  tomoyo_normalize_line(data)
53  If tomoyo_correct_domain(data) Then
54  idx = moyo_read_lock - Take lock for protecting policy.* Returns index number for tomoyo_read_unlock().
58  name = data
59  tomoyo_fill_path_info( & name)
61  tomoyo_init_request_info( & r, NULL, TOMOYO_MAC_FILE_EXECUTE)
62  param_type = TOMOYO_TYPE_MANUAL_TASK_ACL
63  domainname = name
64  moyo_check_acl - Do permission check.*@r: Pointer to "struct tomoyo_request_info".*@check_entry: Callback function to check type specific parameters.* Returns 0 on success, negative value otherwise.* Caller holds tomoyo_read_lock().
65  If Not granted Then error = -EPERM
67  Else
70  If Not new_domain Then
71  error = -ENOENT
72  Else
83  moyo_read_unlock - Release lock for protecting policy.*@idx: Index number returned by tomoyo_read_lock().* Returns nothing.
84  Else error = -EINVAL
86  kfree(data)
87  Return If error Then error Else count