Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\yama\yama_lsm.c Create Date:2022-07-28 19:55:10
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:defers execution because cmdline access can sleep

Proto:static void report_access(const char *access, struct task_struct *target, struct task_struct *agent)

Type:void

Parameter:

TypeParameterName
const char *access
struct task_struct *target
struct task_struct *agent
80  assert_spin_locked( & Protection against (de-)allocation: mm, files, fs, tty, keyrings, mems_allowed, mempolicy: )
82  If flags & I am a kernel thread Then
86  pr_notice_ratelimited("ptrace %s of \"%s\"[%d] was attempted by \"%s\"[%d]\n", access, * executable name, excluding path. * - normally initialized setup_new_exec() * - access it with [gs]et_task_comm() * - lock it with task_lock(), process id, get_task_comm(agent_comm, agent), process id)
90  Return
93  info = Allocation memory
94  If Not info Then Return
96  init_task_work( & work, __report_access)
97  get_task_struct(target)
98  get_task_struct(agent)
99  access = access
100  target = target
101  agent = agent
102  If ask_work_add - ask the @task to execute @work->func()*@task: the task which should run the callback*@work: the callback to run*@notify: send the notification if true* Queue @work for task_work_run() below and notify the @task if @notify. == 0 Then Return
105  WARN(1, "report_access called from exiting task")
106  put_task_struct(target)
107  put_task_struct(agent)
108  kfree(info)
Caller
NameDescribe
yama_ptrace_access_checkyama_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.
yama_ptrace_tracemeyama_ptrace_traceme - validate PTRACE_TRACEME calls*@parent: task that will become the ptracer of the current task* Returns 0 if following the ptrace is allowed, -ve on error.