函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\livepatch\transition.c Create Date:2022-07-27 11:31:47
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称: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.

函数原型:static int klp_check_stack(struct task_struct *task, char *err_buf)

返回类型:int

参数:

类型参数名称
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  如果ret小于0则
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  返回:ret
256  nr_entries等于ret
258  klp_for_each_object(klp_transition_patch, obj)
259  如果非patched则继续下一循环
263  如果ret
273  返回:0
调用者
名称描述
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.