Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:moyo_path_mknod - Target for security_path_mknod().*@parent: Pointer to "struct path".*@dentry: Pointer to "struct dentry".*@mode: DAC permission mode.*@dev: Device attributes.* Returns 0 on success, negative value otherwise.

Proto:static int tomoyo_path_mknod(const struct path *parent, struct dentry *dentry, umode_t mode, unsigned int dev)

Type:int

Parameter:

TypeParameterName
const struct path *parent
struct dentry *dentry
umode_tmode
unsigned intdev
222  struct path path = {mnt = mnt, dentry = dentry}
223  type = TOMOYO_TYPE_CREATE
224  perm = mode & S_IALLUGO
227  Case & == S_IFCHR
228  type = TOMOYO_TYPE_MKCHAR
229  Break
230  Case & == S_IFBLK
231  type = TOMOYO_TYPE_MKBLOCK
232  Break
233  Default
234  Go to no_dev
236  Return moyo_mkdev_perm - Check permission for "mkblock" and "mkchar".*@operation: Type of operation. (TOMOYO_TYPE_MKCHAR or TOMOYO_TYPE_MKBLOCK)*@path: Pointer to "struct path".*@mode: Create mode.*@dev: Device number.
237  no_dev :
239  Case & == S_IFIFO
240  type = TOMOYO_TYPE_MKFIFO
241  Break
242  Case & == S_IFSOCK
243  type = TOMOYO_TYPE_MKSOCK
244  Break
246  Return moyo_path_number_perm - Check permission for "create", "mkdir", "mkfifo", "mksock", "ioctl", "chmod", "chown", "chgrp".*@type: Type of operation.*@path: Pointer to "struct path".*@number: Number.* Returns 0 on success, negative value otherwise.