Function report |
Source Code:security\yama\yama_lsm.c |
Create Date:2022-07-28 19:55:12 |
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
| home page | Tree |
| Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:yama_ptrace_access_check - validate PTRACE_ATTACH calls*@child: task that current task is attempting to ptrace*@mode: ptrace attach mode* Returns 0 if following the ptrace is allowed, -ve on error.
Proto:static int yama_ptrace_access_check(struct task_struct *child, unsigned int mode)
Type:int
Parameter:
| Type | Parameter | Name |
|---|---|---|
| struct task_struct * | child | |
| unsigned int | mode |
| 357 | rc = 0 |
| 360 | If mode & PTRACE_MODE_ATTACH Then |
| 362 | Case ptrace_scope == YAMA_SCOPE_DISABLED |
| 364 | Break |
| 365 | Case ptrace_scope == YAMA_SCOPE_RELATIONAL |
| 374 | Break |
| 375 | Case ptrace_scope == YAMA_SCOPE_CAPABILITY |
| 377 | If Not ns_capable(user_ns, Allow ptrace() of any process ) Then rc = -EPERM |
| 380 | Break |
| 381 | Case ptrace_scope == YAMA_SCOPE_NO_ATTACH |
| 382 | Default |
| 388 | If rc && (mode & PTRACE_MODE_NOAUDIT) == 0 Then defers execution because cmdline access can sleep |
| 391 | Return rc |
| 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 |