Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:parts of the initialization that is done only when the object is loaded

Proto:static int klp_init_object_loaded(struct klp_patch *patch, struct klp_object *obj)

Type:int

Parameter:

TypeParameterName
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  If ret Then
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  Return 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  If ret Then Return ret
762  ret = kallsyms_lookup_size_offset((unsignedlong)rnal , & old_size, NULL)
764  If Not ret Then
765  pr_err("kallsyms size lookup failed for '%s'\n", xternal )
767  Return -ENOENT
770  If nop Then new_func = rnal
773  ret = kallsyms_lookup_size_offset((unsignedlong)new_func, & new_size, NULL)
775  If Not ret Then
776  pr_err("kallsyms size lookup failed for '%s' replacement\n", xternal )
778  Return -ENOENT
782  Return 0
Caller
NameDescribe
klp_init_object
klp_module_coming