函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:parts of the initialization that is done only when the object is loaded

函数原型:static int klp_init_object_loaded(struct klp_patch *patch, struct klp_object *obj)

返回类型:int

参数:

类型参数名称
struct klp_patch *patch
struct klp_object *obj
740  mutex_lock( & mutex protecting text section modification (dynamic code patching).* some users need to sleep (allocating memory...) while they hold this lock.* Note: Also protects SMP-alternatives modification on x86.)
742  module_disable_ro(xternal )
743  ret等于klp_write_object_relocations(xternal , obj)
744  如果ret
745  module_enable_ro(xternal , true)
746  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.
747  返回:ret
750  Arches may override this to finish any remaining arch-specific tasks
751  module_enable_ro(xternal , true)
753  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.
755  klp_for_each_func(obj, func)
756  ret等于klp_find_object_symbol( external , xternal , The old_sympos field is optional and can be used to resolve* duplicate symbol names in livepatch objects, (unsignedlong * ) & rnal )
759  如果ret则返回:ret
762  ret等于kallsyms_lookup_size_offset((unsignedlong)rnal , & old_size, NULL)
764  如果非ret
765  打印错误信息("kallsyms size lookup failed for '%s'\n", xternal )
767  返回:负ENOENT
770  如果nopnew_func等于rnal
773  ret等于kallsyms_lookup_size_offset((unsignedlong)new_func, & new_size, NULL)
775  如果非ret
776  打印错误信息("kallsyms size lookup failed for '%s' replacement\n", xternal )
778  返回:负ENOENT
782  返回:0
调用者
名称描述
klp_init_object
klp_module_coming