函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称: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.

函数原型:static char *tomoyo_get_local_path(struct dentry *dentry, char *const buffer, const int buflen)

返回类型:char

参数:

类型参数名称
struct dentry *dentry
char *constbuffer
const intbuflen
155  sb等于 The root of the dentry tree
156  pos等于moyo_get_dentry_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.
158  如果是错误则返回:pos
161  如果s_magic恒等于PROC_SUPER_MAGICpos恒等于'/'则
163  pid等于转换字符串为无符号整形
165  如果ep恒等于'/'且pidpid恒等于task_tgid_nr_ns(当前进程, Filesystem private info )则
167  pos等于ep减5
168  如果pos小于buffer则转到:out
170  memmove(pos, "/self", 5)
172  转到:prepend_filesystem_name
175  如果非MAJOR( search index; _not_ kdev_t )则转到:prepend_filesystem_name
178  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
184  如果非rename则转到:prepend_filesystem_name
191  dev等于 search index; _not_ kdev_t
193  name[name的长度 - 1]等于'\0'
194  snprintf - Format a string and place it in a buffer*@buf: The buffer to place the result into*@size: The size of the buffer, including the trailing null space*@fmt: The format string to use*@
196  name_len等于strlen - Find the length of a string*@s: The string to be sized
197  pos减等于name_len
198  如果pos小于buffer则转到:out
200  memmove(pos, name, name_len)
201  返回:pos
204  prepend_filesystem_name :
206  name等于name
207  name_len等于strlen - Find the length of a string*@s: The string to be sized
209  pos减等于name_len加1
210  如果pos小于buffer则转到:out
212  memmove(pos, name, name_len)
213  pos[name_len]等于':'
215  返回:pos
216  out :
217  返回:错误号
调用者
名称描述
tomoyo_realpath_from_pathmoyo_realpath_from_path - Returns realpath(3) of the given pathname but ignores chroot'ed root