Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:arch_ptrace

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

Type:long

Parameter:

TypeParameterName
struct task_struct *child
longrequest
unsigned longaddr
unsigned longdata
750  __user * datap = data
754  Case request == PTRACE_PEEKUSR
757  ret = -EIO
758  If addr & size of data - 1 || addr >= sizeof(structuser) Then Break
761  tmp = 0
762  If addr < sizeof(structuser_regs_struct) Then tmp = getreg(child, addr)
764  Else if addr >= offsetof(structuser, u_debugreg[0]) && addr <= offsetof(structuser, u_debugreg[7]) Then
766  addr -= offsetof(structuser, u_debugreg[0])
769  ret = Write a simple value into user space(tmp, datap)
770  Break
773  Case request == PTRACE_POKEUSR
774  ret = -EIO
775  If addr & size of data - 1 || addr >= sizeof(structuser) Then Break
778  If addr < sizeof(structuser_regs_struct) Then ret = putreg(child, addr, data)
780  Else if addr >= offsetof(structuser, u_debugreg[0]) && addr <= offsetof(structuser, u_debugreg[7]) Then
782  addr -= offsetof(structuser, u_debugreg[0])
786  Break
788  Case request == Arbitrarily choose the same ptrace numbers as used by the Sparc code.
789  Return py_regset_to_user - fetch a thread's user_regset data into user memory*@target: thread to be examined*@view: &struct user_regset_view describing user thread machine state*@setno: index in @view->regsets*@offset: offset into the regset data, in
795  Case request == PTRACE_SETREGS
796  Return py_regset_from_user - store into thread's user_regset data from user memory*@target: thread to be examined*@view: &struct user_regset_view describing user thread machine state*@setno: index in @view->regsets*@offset: offset into the regset data, in
802  Case request == PTRACE_GETFPREGS
803  Return py_regset_to_user - fetch a thread's user_regset data into user memory*@target: thread to be examined*@view: &struct user_regset_view describing user thread machine state*@setno: index in @view->regsets*@offset: offset into the regset data, in
809  Case request == PTRACE_SETFPREGS
810  Return py_regset_from_user - store into thread's user_regset data from user memory*@target: thread to be examined*@view: &struct user_regset_view describing user thread machine state*@setno: index in @view->regsets*@offset: offset into the regset data, in
817  Case request == PTRACE_GETFPXREGS
818  Return If py_regset_to_user - fetch a thread's user_regset data into user memory*@target: thread to be examined*@view: &struct user_regset_view describing user thread machine state*@setno: index in @view->regsets*@offset: offset into the regset data, in Then -EIO Else 0
823  Case request == PTRACE_SETFPXREGS
824  Return If py_regset_from_user - store into thread's user_regset data from user memory*@target: thread to be examined*@view: &struct user_regset_view describing user thread machine state*@setno: index in @view->regsets*@offset: offset into the regset data, in Then -EIO Else 0
831  Case request == ly useful for access 32bit programs / kernels
832  If addr < 0 Then Return -EIO
834  ret = do_get_thread_area(child, addr, (structuser_desc__user * )data)
836  Break
838  Case request == PTRACE_SET_THREAD_AREA
839  If addr < 0 Then Return -EIO
841  ret = do_set_thread_area(child, addr, (structuser_desc__user * )data, 0)
843  Break
850  Case request == PTRACE_ARCH_PRCTL
851  ret = do_arch_prctl_64(child, data, addr)
852  Break
855  Default
856  ret = ptrace_request(child, request, addr, data)
857  Break
860  Return ret