函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:__klp_enable_patch

函数原型:static int __klp_enable_patch(struct klp_patch *patch)

返回类型:int

参数:

类型参数名称
struct klp_patch *patch
927  如果klp_transition_patch则返回:负EBUSY
930  如果WARN_ON(enabled)则返回:负EINVAL
933  打印注释信息("enabling patch '%s'\n", Unique handle for this module )
935  Initialize the global target patch state and all tasks to the initial patch* state, and initialize all function transition states to true in preparation* for patching or unpatching.
944  smp_wmb()
946  klp_for_each_object(patch, obj)
947  如果非klp_is_object_loaded(obj)则继续下一循环
950  ret等于klp_pre_patch_callback(obj)
951  如果ret
952  打印警告信息("pre-patch callback failed for object '%s'\n", klp_is_module(obj) ? external : "vmlinux")
954  转到:err
957  ret等于klp_patch_object(obj)
958  如果ret
959  打印警告信息("failed to patch object '%s'\n", klp_is_module(obj) ? external : "vmlinux")
961  转到:err
965  Start the transition to the specified target patch state so tasks can begin* switching to it.
966  enabled = true
967  Try to switch all remaining tasks to the target patch state by walking the* stacks of sleeping tasks and looking for any to-be-patched or* to-be-unpatched functions. If such functions are found, the task can't be* switched yet.
969  返回:0
970  err :
971  打印警告信息("failed to enable patch '%s'\n", Unique handle for this module )
973  klp_cancel_transition()
974  返回:ret
调用者
名称描述
klp_enable_patchklp_enable_patch() - enable the livepatch*@patch: patch to be enabled* Initializes the data structure associated with the patch, creates the sysfs* interface, performs the needed symbol lookups and code relocations,