函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:ptrace_request

函数原型:int ptrace_request(struct task_struct *child, long request, unsigned long addr, unsigned long data)

返回类型:int

参数:

类型参数名称
struct task_struct *child
longrequest
unsigned longaddr
unsigned longdata
1005  seized等于ptrace按位与SEIZE used, enable new behavior
1006  ret等于负EIO
1008  __userdatavp等于data
1009  __userdatalp等于datavp
1013  :request恒等于PTRACE_PEEKTEXT
1014  :request恒等于PTRACE_PEEKDATA
1015  返回:generic_ptrace_peekdata(child, addr, data)
1016  :request恒等于PTRACE_POKETEXT
1017  :request恒等于PTRACE_POKEDATA
1018  返回:generic_ptrace_pokedata(child, addr, data)
1021  :request恒等于PTRACE_OLDSETOPTIONS
1023  :request恒等于0x4200-0x4300 are reserved for architecture-independent additions.
1024  ret等于ptrace_setoptions(child, data)
1025  退出
1026  :request恒等于PTRACE_GETEVENTMSG
1027  ret等于put_user - Write a simple value into user space( Ptrace state: , datalp)
1028  退出
1030  :request恒等于PTRACE_PEEKSIGINFO
1031  ret等于ptrace_peek_siginfo(child, addr, data)
1032  退出
1034  :request恒等于PTRACE_GETSIGINFO
1035  ret等于ptrace_getsiginfo(child, & siginfo)
1036  如果非retret等于copy_siginfo_to_user(datavp, & siginfo)
1038  退出
1040  :request恒等于PTRACE_SETSIGINFO
1041  ret等于copy_siginfo_from_user( & siginfo, datavp)
1042  如果非retret等于ptrace_setsiginfo(child, & siginfo)
1044  退出
1046  :request恒等于PTRACE_GETSIGMASK
1049  如果addr不等于sizeof(sigset_t)则
1050  ret等于负EINVAL
1051  退出
1054  如果test_tsk_restore_sigmask(child)则mask等于 Restored if set_restore_sigmask() was used:
1056  否则mask等于需要阻塞的信号
1059  如果copy_to_user(datavp, mask, sizeof(sigset_t))则ret等于负EFAULT
1061  否则ret等于0
1064  退出
1067  :request恒等于PTRACE_SETSIGMASK
1070  如果addr不等于sizeof(sigset_t)则
1071  ret等于负EINVAL
1072  退出
1075  如果copy_from_user( & new_set, datavp, sizeof(sigset_t))则
1076  ret等于负EFAULT
1077  退出
1080  sigdelsetmask( & new_set, sigmask(SIGKILL) | sigmask(SIGSTOP))
1087  spin_lock_irq( & siglock)
1088  需要阻塞的信号等于new_set
1089  spin_unlock_irq( & siglock)
1091  clear_tsk_restore_sigmask(child)
1093  ret等于0
1094  退出
1097  :request恒等于PTRACE_INTERRUPT
1108  如果此条件成立可能性小(为编译器优化)(!seized || !lock_task_sighand(child, & flags))则退出
1117  如果此条件成立可能性大(为编译器优化)(task_set_jobctl_pending(child, JOBCTL_TRAP_STOP))则ptrace_signal_wake_up(child, JOBCTL_*, siglock protected: & JOBCTL_LISTENING)
1120  unlock_task_sighand(child, & flags)
1121  ret等于0
1122  退出
1124  :request恒等于PTRACE_LISTEN
1133  如果此条件成立可能性小(为编译器优化)(!seized || !lock_task_sighand(child, & flags))则退出
1136  si等于last_siginfo
1145  ret等于0
1147  unlock_task_sighand(child, & flags)
1148  退出
1150  :request恒等于PTRACE_DETACH
1151  ret等于ptrace_detach(child, data)
1152  退出
1181  :request恒等于PTRACE_SINGLESTEP
1184  :request恒等于sume execution until next branch
1187  :request恒等于PTRACE_SYSEMU
1188  :request恒等于PTRACE_SYSEMU_SINGLESTEP
1190  :request恒等于PTRACE_SYSCALL
1191  :request恒等于PTRACE_CONT
1192  返回:ptrace_resume(child, request, data)
1194  :request恒等于PTRACE_KILL
1195  如果进程退出时状态则返回:0
1197  返回:ptrace_resume(child, request, SIGKILL)
1223  :request恒等于PTRACE_SECCOMP_GET_FILTER
1224  ret等于seccomp_get_filter(child, addr, datavp)
1225  退出
1227  :request恒等于PTRACE_SECCOMP_GET_METADATA
1228  ret等于seccomp_get_metadata(child, addr, datavp)
1229  退出
1231  默认
1232  退出
1235  返回:ret
调用者
名称描述
compat_ptrace_request
arch_ptrace