Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\sys.c Create Date:2022-07-28 09:21:01
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:prctl_set_mm_exe_file

Proto:static int prctl_set_mm_exe_file(struct mm_struct *mm, unsigned int fd)

Type:int

Parameter:

TypeParameterName
struct mm_struct *mm
unsigned intfd
1821  exe = fdget(fd)
1822  If Not file Then Return -EBADF
1825  inode = file_inode(file)
1832  err = -EACCES
1833  If Not S_ISREG(i_mode) || path_noexec( & f_path) Then Go to exit
1836  err = inode_permission(inode, MAY_EXEC)
1837  If err Then Go to 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  If exe_file Then
1848  lock for reading
1849  When vma cycle
1850  If Not File we map to (can be NULL). Then Continue
1852  If path_equal( & f_path, & f_path) Then Go to 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  If old_exe Then fput(old_exe)
1867  exit :
1868  fdput(exe)
1869  Return err
1870  exit_err :
1871  lease a read lock
1872  fput(exe_file)
1873  Go to exit
Caller
NameDescribe
prctl_set_mm