Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:moyo_realpath_from_path - Returns realpath(3) of the given pathname but ignores chroot'ed root

Proto:char *tomoyo_realpath_from_path(const struct path *path)

Type:char

Parameter:

TypeParameterName
const struct path *path
237  char * buf = NULL
238  char * name = NULL
239  buf_len = PAGE_SIZE / 2
240  dentry = dentry
243  If Not dentry Then Return NULL
245  sb = The root of the dentry tree
246  When 1 cycle
250  buf_len <<= 1
251  kfree(buf)
252  buf = Allocation memory
253  If Not buf Then Break
256  buf[buf_len - 1] = '\0'
258  If d_op && d_dname Then
259  pos = d_dname(dentry, buf, buf_len - 1)
260  Go to 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  If Not mnt || Not rename && Not (fs_flags & FS_REQUIRES_DEV) Then 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  Else
283  encode :
284  If IS_ERR(pos) Then Continue
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  Break
289  kfree(buf)
290  If Not name Then moyo_warn_oom - Print out of memory warning message.*@function: Function's name.
292  Return name
Caller
NameDescribe
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.