函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:SYSCALL_DEFINE5

函数原型:SYSCALL_DEFINE5(kcmp, pid_t, pid1, pid_t, pid2, int, type, unsigned long, idx1, unsigned long, idx2)

返回类型:

参数:

158  _read_lock() - mark the beginning of an RCU read-side critical section* When synchronize_rcu() is invoked on one CPU while other CPUs* are within RCU read-side critical sections, then the* synchronize_rcu() is guaranteed to block until after all the other
163  task1等于find_task_by_vpid(pid1)
164  task2等于find_task_by_vpid(pid2)
165  如果非task1或非task2则转到:err_no_task
168  get_task_struct(task1)
169  get_task_struct(task2)
171  _read_unlock() - marks the end of an RCU read-side critical section.* In most situations, rcu_read_unlock() is immune from deadlock.* However, in kernels built with CONFIG_RCU_BOOST, rcu_read_unlock()
176  ret等于kcmp_lock( & cred_guard_mutex, & cred_guard_mutex)
178  如果ret则转到:err
180  如果非ptrace_may_access(task1, PTRACE_MODE_READ_REALCREDS)或非ptrace_may_access(task2, PTRACE_MODE_READ_REALCREDS)则
182  ret等于负EPERM
183  转到:err_unlock
187  :type恒等于KCMP_FILE
195  否则ret等于负EBADF
197  退出
199  :type恒等于KCMP_VM
200  ret等于0 - equal, i.e. v1 = v2* 1 - less than, i.e. v1 < v2* 2 - greater than, i.e. v1 > v2* 3 - not equal but ordering unavailable (reserved for future)
201  退出
202  :type恒等于KCMP_FILES
203  ret等于0 - equal, i.e. v1 = v2* 1 - less than, i.e. v1 < v2* 2 - greater than, i.e. v1 > v2* 3 - not equal but ordering unavailable (reserved for future)
204  退出
205  :type恒等于KCMP_FS
206  ret等于0 - equal, i.e. v1 = v2* 1 - less than, i.e. v1 < v2* 2 - greater than, i.e. v1 > v2* 3 - not equal but ordering unavailable (reserved for future)
207  退出
208  :type恒等于KCMP_SIGHAND
209  ret等于0 - equal, i.e. v1 = v2* 1 - less than, i.e. v1 < v2* 2 - greater than, i.e. v1 > v2* 3 - not equal but ordering unavailable (reserved for future)
210  退出
211  :type恒等于KCMP_IO
212  ret等于0 - equal, i.e. v1 = v2* 1 - less than, i.e. v1 < v2* 2 - greater than, i.e. v1 > v2* 3 - not equal but ordering unavailable (reserved for future)
213  退出
214  :type恒等于KCMP_SYSVSEM
216  ret等于0 - equal, i.e. v1 = v2* 1 - less than, i.e. v1 < v2* 2 - greater than, i.e. v1 > v2* 3 - not equal but ordering unavailable (reserved for future)
222  退出
223  :type恒等于KCMP_EPOLL_TFD
224  ret等于kcmp_epoll_target(task1, task2, idx1, (void * )idx2)
225  退出
226  默认
227  ret等于负EINVAL
228  退出
231  err_unlock :
232  kcmp_unlock( & cred_guard_mutex, & cred_guard_mutex)
234  err :
235  put_task_struct(task1)
236  put_task_struct(task2)
238  返回:ret
240  err_no_task :
241  _read_unlock() - marks the end of an RCU read-side critical section.* In most situations, rcu_read_unlock() is immune from deadlock.* However, in kernels built with CONFIG_RCU_BOOST, rcu_read_unlock()
242  返回:负ESRCH