函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\tomoyo\realpath.c Create Date:2022-07-27 21:14:56
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:moyo_realpath_from_path - Returns realpath(3) of the given pathname but ignores chroot'ed root

函数原型:char *tomoyo_realpath_from_path(const struct path *path)

返回类型:char

参数:

类型参数名称
const struct path *path
237  char * buf = NULL
238  char * name = NULL
239  buf_len等于PAGE_SIZE除2
240  dentry等于dentry
243  如果非dentry则返回:NULL
245  sb等于 The root of the dentry tree
246  当1循环
250  buf_len左移等于1位
251  释放内存
252  buf等于开辟内存
253  如果非buf退出
256  buf[buf_len - 1]等于'\0'
258  如果d_opd_dname
259  pos等于d_dname(dentry, buf, buf_len - 1)
260  转到:encode
262  inode等于d_backing_inode - Get upper or lower inode we should be using*@upper: The upper layer* This is the helper that should be used to get at the inode that will be used* if this dentry were to be opened as a file. The inode may be on the upper
267  如果非mnt或非rename且非fs_flags按位与FS_REQUIRES_DEV的值则pos等于moyo_get_local_path - Get the path of a dentry.*@dentry: Pointer to "struct dentry".*@buffer: Pointer to buffer to return value in.*@buflen: Sizeof @buffer.* Returns the buffer on success, an error code otherwise.
273  否则
283  encode :
284  如果是错误则继续下一循环
286  name等于moyo_encode - Encode binary string to ascii string.*@str: String in binary format.* Returns pointer to @str in ascii format on success, NULL otherwise.* This function uses kzalloc(), so caller must kfree() if this function* didn't return NULL.
287  退出
289  释放内存
290  如果非namemoyo_warn_oom - Print out of memory warning message.*@function: Function's name.
292  返回:name
调用者
名称描述
tomoyo_scan_exec_realpathmoyo_scan_exec_realpath - Check "exec.realpath" parameter of "struct tomoyo_condition".*@file: Pointer to "struct file".*@ptr: Pointer to "struct tomoyo_name_union".*@match: True if "exec.realpath=", false if "exec.realpath!=".
tomoyo_get_realpathmoyo_get_realpath - Get realpath.*@buf: Pointer to "struct tomoyo_path_info".*@path: Pointer to "struct path".* Returns true on success, false otherwise.
tomoyo_mount_aclmoyo_mount_acl - Check permission for mount() operation.*@r: Pointer to "struct tomoyo_request_info".*@dev_name: Name of device file. Maybe NULL.*@dir: Pointer to "struct path".*@type: Name of filesystem type.*@flags: Mount options.
tomoyo_realpath_nofollowmoyo_realpath_nofollow - Get realpath of a pathname.*@pathname: The pathname to solve.* Returns the realpath of @pathname on success, NULL otherwise.
tomoyo_get_exemoyo_get_exe - Get tomoyo_realpath() of current process.* Returns the tomoyo_realpath() of current process on success, NULL otherwise.* This function uses kzalloc(), so the caller must call kfree()* if this function didn't return NULL.