函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:arch_ptrace

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

返回类型:long

参数:

类型参数名称
struct task_struct *child
longrequest
unsigned longaddr
unsigned longdata
750  __userdatap等于data
754  :request恒等于PTRACE_PEEKUSR
757  ret等于负EIO
758  如果addr按位与data的长度减1或addr大于等于sizeof(structuser)则退出
761  tmp等于0
762  如果addr小于sizeof(structuser_regs_struct)则tmp等于getreg(child, addr)
764  否则如果addr大于等于offsetof(structuser, u_debugreg[0])且addr小于等于offsetof(structuser, u_debugreg[7])则
766  addr减等于offsetof(structuser, u_debugreg[0])
769  ret等于put_user - Write a simple value into user space(tmp, datap)
770  退出
773  :request恒等于PTRACE_POKEUSR
774  ret等于负EIO
775  如果addr按位与data的长度减1或addr大于等于sizeof(structuser)则退出
778  如果addr小于sizeof(structuser_regs_struct)则ret等于putreg(child, addr, data)
780  否则如果addr大于等于offsetof(structuser, u_debugreg[0])且addr小于等于offsetof(structuser, u_debugreg[7])则
782  addr减等于offsetof(structuser, u_debugreg[0])
786  退出
788  :request恒等于Arbitrarily choose the same ptrace numbers as used by the Sparc code.
789  返回: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  :request恒等于PTRACE_SETREGS
796  返回: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  :request恒等于PTRACE_GETFPREGS
803  返回: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  :request恒等于PTRACE_SETFPREGS
810  返回: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  :request恒等于PTRACE_GETFPXREGS
818  返回:如果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 则负EIO否则0
823  :request恒等于PTRACE_SETFPXREGS
824  返回:如果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 则负EIO否则0
831  :request恒等于ly useful for access 32bit programs / kernels
832  如果addr小于0则返回:负EIO
834  ret等于do_get_thread_area(child, addr, (structuser_desc__user * )data)
836  退出
838  :request恒等于PTRACE_SET_THREAD_AREA
839  如果addr小于0则返回:负EIO
841  ret等于do_set_thread_area(child, addr, (structuser_desc__user * )data, 0)
843  退出
850  :request恒等于PTRACE_ARCH_PRCTL
851  ret等于do_arch_prctl_64(child, data, addr)
852  退出
855  默认
856  ret等于ptrace_request(child, request, addr, data)
857  退出
860  返回:ret
调用者
名称描述
SYSCALL_DEFINE4