Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\livepatch\transition.c Create Date:2022-07-28 10:31:57
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Determine whether it's safe to transition the task to the target patch state* by looking for any to-be-patched or to-be-unpatched functions on its stack.

Proto:static int klp_check_stack(struct task_struct *task, char *err_buf)

Type:int

Parameter:

TypeParameterName
struct task_struct *task
char *err_buf
249  ret = stack_trace_save_tsk_reliable(task, entries, ARRAY_SIZE - get the number of elements in array @arr*@arr: array to be sized(entries))
250  If ret < 0 Then
251  snprintf - Format a string and place it in a buffer*@buf: The buffer to place the result into*@size: The size of the buffer, including the trailing null space*@fmt: The format string to use*@
254  Return ret
256  nr_entries = ret
258  klp_for_each_object(klp_transition_patch, obj)
259  If Not patched Then Continue
263  If ret Then
273  Return 0
Caller
NameDescribe
klp_try_switch_taskTry to safely switch a task to the target patch state. If it's currently* running, or it's sleeping on a to-be-patched or to-be-unpatched function, or* if the stack is unreliable, return false.