函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\open.c Create Date:2022-07-29 10:30:58
Last Modify:2020-03-18 10:16:03 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:access() needs to use the real uid/gid, not the effective uid/gid.* We do this by temporarily clearing all FS-related capabilities and* switching the fsuid/fsgid around to the real ones.

函数原型:long do_faccessat(int dfd, const char __user *filename, int mode)

返回类型:long

参数:

类型参数名称
intdfd
const char __user *filename
intmode
355  lookup_flags等于llow links at the end
357  如果mode按位与S_IRWXO的反则返回:负EINVAL
360  override_cred等于prepare_creds - Prepare a new set of credentials for modification* Prepare a new set of task credentials for modification
361  如果非override_cred则返回:负ENOMEM
364  UID for VFS ops 等于进程uid
365  GID for VFS ops 等于进程gid
367  如果非issecure(When set, setuid to/from uid 0 does not trigger capability-"fixup".When unset, to provide compatiblility with old programs relying onset*uid to gain/lose privilege, transitions to/from uid 0 causecapabilities to be gained/lost. )则
369  root_uid等于make_kuid( user_ns the caps and keyrings are relative to. , 0)
370  如果非uid_eq(进程uid, root_uid)则cap_clear( caps we can actually use )
372  否则 caps we can actually use 等于 caps we're permitted
394  Can we skip RCU deletion? 等于1
396  old_cred等于verride_creds - Override the current process's subjective credentials*@new: The credentials to be assigned* Install a set of temporary override subjective credentials on the current* process, returning the old set for later reversion.
397  retry :
398  res等于user_path_at(dfd, filename, lookup_flags, & path)
399  如果res则转到:out
402  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
404  如果mode按位与MAY_EXECS_ISREG(i_mode)则
409  res等于负EACCES
410  如果path_noexec( & path)则转到:out_path_release
414  res等于inode_permission(inode, mode | MAY_ACCESS)
416  如果res或非mode按位与S_IWOTH的值或special_file(i_mode)则转到:out_path_release
428  如果__mnt_is_readonly(mnt)则res等于负EROFS
431  out_path_release :
432  path_put( & path)
433  如果ry_estale - determine whether the caller should retry an operation*@error: the error that would currently be returned*@flags: flags being used for next lookup attempt* Check to see if the error code was -ESTALE, and then determine whether
434  lookup_flags或等于ll ->d_revalidate() to trust no cache
435  转到:retry
437  out :
438  vert_creds - Revert a temporary subjective credentials override*@old: The credentials to be restored* Revert a temporary set of override subjective credentials to an old set,* discarding the override set.
439  put_cred - Release a reference to a set of credentials*@cred: The credentials to release* Release a reference to a set of credentials, deleting them when the last ref* is released
440  返回:res
调用者
名称描述
SYSCALL_DEFINE3
SYSCALL_DEFINE2
ksys_access