函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:prctl_set_mm_exe_file

函数原型:static int prctl_set_mm_exe_file(struct mm_struct *mm, unsigned int fd)

返回类型:int

参数:

类型参数名称
struct mm_struct *mm
unsigned intfd
1821  exe等于fdget(fd)
1822  如果非file则返回:负EBADF
1825  inode等于file_inode(file)
1832  err等于负EACCES
1833  如果非S_ISREG(i_mode)或path_noexec( & f_path)则转到:exit
1836  err等于inode_permission(inode, MAY_EXEC)
1837  如果err则转到:exit
1843  exe_file等于get_mm_exe_file - acquire a reference to the mm's executable file* Returns %NULL if mm has no associated executable file.* User must release file via fput().
1844  err等于负EBUSY
1845  如果exe_file
1848  lock for reading
1849 vma循环
1850  如果非File we map to (can be NULL). 则继续下一循环
1852  如果path_equal( & f_path, & f_path)则转到:exit_err
1857  lease a read lock
1858  fput(exe_file)
1861  err等于0
1863  get_file(file)
1864  old_exe等于xchg( & store ref to file /proc//exe symlink points to , file)
1865  如果old_exefput(old_exe)
1867  exit :
1868  fdput(exe)
1869  返回:err
1870  exit_err :
1871  lease a read lock
1872  fput(exe_file)
1873  转到:exit
调用者
名称描述
prctl_set_mm