Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:SYSCALL_DEFINE5

Proto:SYSCALL_DEFINE5(kcmp, pid_t, pid1, pid_t, pid2, int, type, unsigned long, idx1, unsigned long, idx2)

Type:

Parameter:Nothing

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  If Not task1 || Not task2 Then Go to 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  If ret Then Go to err
180  If Not ptrace_may_access(task1, PTRACE_MODE_READ_REALCREDS) || Not ptrace_may_access(task2, PTRACE_MODE_READ_REALCREDS) Then
182  ret = -EPERM
183  Go to err_unlock
187  Case type == KCMP_FILE
195  Else ret = -EBADF
197  Break
199  Case 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  Break
202  Case 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  Break
205  Case 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  Break
208  Case 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  Break
211  Case 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  Break
214  Case 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  Break
223  Case type == KCMP_EPOLL_TFD
224  ret = kcmp_epoll_target(task1, task2, idx1, (void * )idx2)
225  Break
226  Default
227  ret = -EINVAL
228  Break
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  Return 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  Return -ESRCH