Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name: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,

Proto:int klp_enable_patch(struct klp_patch *patch)

Type:int

Parameter:

TypeParameterName
struct klp_patch *patch
994  If Not patch || Not xternal Then Return -EINVAL
997  If Not is_livepatch_module(xternal ) Then
998  pr_err("module %s is not marked as a livepatch module\n", Unique handle for this module )
1000  Return -EINVAL
1003  If Not klp_initialized() Then Return -ENODEV
1006  If Not klp_have_reliable_stack() Then
1007  pr_warn("This architecture doesn't have support for the livepatch consistency model.\n")
1008  pr_warn("The livepatch transition may never complete.\n")
1011  mutex_lock( & klp_mutex is a coarse lock which serializes access to klp data)
1013  If Not klp_is_patch_compatible(patch) Then
1014  pr_err("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  Return -EINVAL
1020  ret = klp_init_patch_early(patch)
1021  If ret Then
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  Return ret
1026  ret = klp_init_patch(patch)
1027  If ret Then Go to err
1030  ret = __klp_enable_patch(patch)
1031  If ret Then Go to 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  Return 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  Return ret
Caller
NameDescribe
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