函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

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

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

返回类型:int

参数:

类型参数名称
struct klp_patch *patch
994  如果非patch或非xternal 则返回:负EINVAL
997  如果非is_livepatch_module(xternal )则
998  打印错误信息("module %s is not marked as a livepatch module\n", Unique handle for this module )
1000  返回:负EINVAL
1003  如果非klp_initialized()则返回:负ENODEV
1006  如果非klp_have_reliable_stack()则
1007  打印警告信息("This architecture doesn't have support for the livepatch consistency model.\n")
1008  打印警告信息("The livepatch transition may never complete.\n")
1011  mutex_lock( & klp_mutex is a coarse lock which serializes access to klp data)
1013  如果非klp_is_patch_compatible(patch)则
1014  打印错误信息("Livepatch patch (%s) is not compatible with the already installed livepatches.\n", Unique handle for this module )
1016  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
1017  返回:负EINVAL
1020  ret等于klp_init_patch_early(patch)
1021  如果ret
1022  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
1023  返回:ret
1026  ret等于klp_init_patch(patch)
1027  如果ret则转到:err
1030  ret等于__klp_enable_patch(patch)
1031  如果ret则转到:err
1034  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
1036  返回:0
1038  err :
1039  This function implements the free operations that can be called safely* under klp_mutex.* The operation must be completed by calling klp_free_patch_finish()* outside klp_mutex.
1041  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
1043  This function implements the free part that must be called outside* klp_mutex.* It must be called after klp_free_patch_start(). And it has to be* the last function accessing the livepatch structures when the patch* gets disabled.
1045  返回:ret
调用者
名称描述
test_klp_callbacks_demo_init
test_klp_callbacks_demo2_init
test_klp_livepatch_init
test_klp_callbacks_demo_init
test_klp_callbacks_demo_init
test_klp_atomic_replace_init