函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:ptrace_peek_siginfo

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

返回类型:int

参数:

类型参数名称
struct task_struct *child
unsigned longaddr
unsigned longdata
715  ret等于copy_from_user( & arg, (void__user * )addr, sizeof(structptrace_peeksiginfo_args))
717  如果ret则返回:负EFAULT
720  如果flags按位与Read signals from a shared (process wide) queue 的反则返回:负EINVAL
723  如果 how may siginfos to take 小于0则返回:负EINVAL
727  如果 from which siginfo to start 大于ULONG_MAX则返回:0
730  如果flags按位与Read signals from a shared (process wide) queue pending等于shared_pending
732  否则pending等于待处理信号
735 i小于 how may siginfos to take 循环
737  off等于 from which siginfo to start i
738  bool found = false
740  spin_lock_irq( & siglock)
742  如果非off自减则
743  found = true
744  copy_siginfo( & info, & info)
745  退出
748  spin_unlock_irq( & siglock)
750  如果非found退出
754  如果此条件成立可能性小(为编译器优化)(in_compat_syscall())则
755  __useruinfo等于A pointer passed in from user mode. This should not* be used for syscall parameters, just declare them* as pointers because the syscall entry code will have* appropriately converted them already.
757  如果copy_siginfo_to_user32(uinfo, & info)则
758  ret等于负EFAULT
759  退出
762  否则
765  __useruinfo等于data
767  如果copy_siginfo_to_user(uinfo, & info)则
768  ret等于负EFAULT
769  退出
773  data加等于sizeof(siginfo_t)
774  i自加
776  如果signal_pending(当前进程)则退出
779  cond_resched()
782  如果i大于0则返回:i
785  返回:ret
调用者
名称描述
ptrace_request