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:45
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Handle ptrace writes to debug register 7.

Proto:static int ptrace_write_dr7(struct task_struct *tsk, unsigned long data)

Type:int

Parameter:

TypeParameterName
struct task_struct *tsk
unsigned longdata
579  thread = * New fields for task_struct should be added above here, so that * they are included in the randomized portion of task_struct.
581  bool second_pass = false
582  ret = 0
584  data &= ~Reserved
585  old_dr7 = Walk through every ptrace breakpoints for this thread and* build the dr7 value on top of their attributes.
587  restore :
588  rc = 0
589  When i < Total number of available HW breakpoint registers cycle
591  disabled = Not Decode the length and type bits for a particular breakpoint as* stored in debug register 7. Return the "enabled" status.
592  bp = Save middle states of ptrace breakpoints [i]
594  If Not bp Then
595  If disabled Then Continue
600  If IS_ERR(bp) Then
601  rc = PTR_ERR(bp)
602  Break
606  Continue
609  rc = ptrace_modify_breakpoint(bp, len, type, disabled)
610  If rc Then Break
615  If rc && Not WARN_ON(second_pass) Then
616  ret = rc
617  data = old_dr7
618  second_pass = true
619  Go to restore
622  Return ret
Caller
NameDescribe
ptrace_set_debugregHandle PTRACE_POKEUSR calls for the debug register area.