Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:ptrace_request

Proto:int ptrace_request(struct task_struct *child, long request, unsigned long addr, unsigned long data)

Type:int

Parameter:

TypeParameterName
struct task_struct *child
longrequest
unsigned longaddr
unsigned longdata
1005  seized = ptrace & SEIZE used, enable new behavior
1006  ret = -EIO
1008  __user * datavp = data
1009  __user * datalp = datavp
1013  Case request == PTRACE_PEEKTEXT
1014  Case request == PTRACE_PEEKDATA
1015  Return generic_ptrace_peekdata(child, addr, data)
1016  Case request == PTRACE_POKETEXT
1017  Case request == PTRACE_POKEDATA
1018  Return generic_ptrace_pokedata(child, addr, data)
1021  Case request == PTRACE_OLDSETOPTIONS
1023  Case request == 0x4200-0x4300 are reserved for architecture-independent additions.
1024  ret = ptrace_setoptions(child, data)
1025  Break
1026  Case request == PTRACE_GETEVENTMSG
1027  ret = Write a simple value into user space( Ptrace state: , datalp)
1028  Break
1030  Case request == PTRACE_PEEKSIGINFO
1031  ret = ptrace_peek_siginfo(child, addr, data)
1032  Break
1034  Case request == PTRACE_GETSIGINFO
1035  ret = ptrace_getsiginfo(child, & siginfo)
1036  If Not ret Then ret = copy_siginfo_to_user(datavp, & siginfo)
1038  Break
1040  Case request == PTRACE_SETSIGINFO
1041  ret = copy_siginfo_from_user( & siginfo, datavp)
1042  If Not ret Then ret = ptrace_setsiginfo(child, & siginfo)
1044  Break
1046  Case request == PTRACE_GETSIGMASK
1049  If addr != sizeof(sigset_t) Then
1050  ret = -EINVAL
1051  Break
1054  If test_tsk_restore_sigmask(child) Then mask = Restored if set_restore_sigmask() was used:
1056  Else mask = blocked
1059  If copy_to_user(datavp, mask, sizeof(sigset_t)) Then ret = -EFAULT
1061  Else ret = 0
1064  Break
1067  Case request == PTRACE_SETSIGMASK
1070  If addr != sizeof(sigset_t) Then
1071  ret = -EINVAL
1072  Break
1075  If copy_from_user( & new_set, datavp, sizeof(sigset_t)) Then
1076  ret = -EFAULT
1077  Break
1080  sigdelsetmask( & new_set, sigmask(SIGKILL) | sigmask(SIGSTOP))
1087  spin_lock_irq( & siglock)
1088  blocked = new_set
1089  spin_unlock_irq( & siglock)
1091  clear_tsk_restore_sigmask(child)
1093  ret = 0
1094  Break
1097  Case request == PTRACE_INTERRUPT
1108  If Value for the false possibility is greater at compile time(!seized || !lock_task_sighand(child, & flags)) Then Break
1117  If Value is more likely to compile time(task_set_jobctl_pending(child, JOBCTL_TRAP_STOP)) Then ptrace_signal_wake_up(child, siglock protected & JOBCTL_LISTENING)
1120  unlock_task_sighand(child, & flags)
1121  ret = 0
1122  Break
1124  Case request == PTRACE_LISTEN
1133  If Value for the false possibility is greater at compile time(!seized || !lock_task_sighand(child, & flags)) Then Break
1136  si = last_siginfo
1145  ret = 0
1147  unlock_task_sighand(child, & flags)
1148  Break
1150  Case request == PTRACE_DETACH
1151  ret = ptrace_detach(child, data)
1152  Break
1181  Case request == PTRACE_SINGLESTEP
1184  Case request == sume execution until next branch
1187  Case request == PTRACE_SYSEMU
1188  Case request == PTRACE_SYSEMU_SINGLESTEP
1190  Case request == PTRACE_SYSCALL
1191  Case request == PTRACE_CONT
1192  Return ptrace_resume(child, request, data)
1194  Case request == PTRACE_KILL
1195  If exit state Then Return 0
1197  Return ptrace_resume(child, request, SIGKILL)
1223  Case request == PTRACE_SECCOMP_GET_FILTER
1224  ret = seccomp_get_filter(child, addr, datavp)
1225  Break
1227  Case request == PTRACE_SECCOMP_GET_METADATA
1228  ret = seccomp_get_metadata(child, addr, datavp)
1229  Break
1231  Default
1232  Break
1235  Return ret
Caller
NameDescribe
compat_ptrace_request