Function report |
Source Code:kernel\ptrace.c |
Create Date:2022-07-28 09:13:17 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:ptrace_attach
Proto:static int ptrace_attach(struct task_struct *task, long request, unsigned long addr, unsigned long flags)
Type:int
Parameter:
Type | Parameter | Name |
---|---|---|
struct task_struct * | task | |
long | request | |
unsigned long | addr | |
unsigned long | flags |
367 | seize = request == PTRACE_SEIZE |
371 | If seize Then |
374 | If flags & ~PTRACE_O_MASK Then Go to out |
376 | flags = PT_PTRACED | SEIZE used, enable new behavior | flags << PT_OPT_FLAG_SHIFT |
377 | Else |
378 | flags = PT_PTRACED |
381 | audit_ptrace(task) |
384 | If Value for the false possibility is greater at compile time( Per task flags (PF_*), defined further below: & I am a kernel thread ) Then Go to out |
386 | If same_thread_group(task, current process) Then Go to out |
394 | retval = -ERESTARTNOINTR |
395 | If mutex_lock_interruptible( & cred_guard_mutex) Then Go to out |
400 | task_unlock(task) |
401 | If retval Then Go to unlock_creds |
404 | write_lock_irq( & tasklist_lock) |
406 | If Value for the false possibility is greater at compile time(exit state) Then Go to unlock_tasklist |
408 | If ptrace Then Go to unlock_tasklist |
411 | If seize Then flags |= SEIZE used, enable new behavior |
418 | If Not seize Then send_sig_info(SIGSTOP, SEND_SIG_PRIV, task) |
440 | If task_is_stopped(task) && task_set_jobctl_pending(task, JOBCTL_TRAP_STOP | JOBCTL_TRAPPING) Then signal_wake_up_state(task, __TASK_STOPPED) |
444 | spin_unlock( & siglock) |
446 | retval = 0 |
447 | unlock_tasklist : |
448 | write_unlock_irq( & tasklist_lock) |
449 | unlock_creds : |
450 | mutex_unlock( & cred_guard_mutex) |
451 | out : |
452 | If Not retval Then |
464 | Return retval |
Name | Describe |
---|---|
SYSCALL_DEFINE4 | |
COMPAT_SYSCALL_DEFINE4 |
Source code conversion tool public plug-in interface | X |
---|---|
Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |