€•�·Œsphinx.addnodes”Œdocument”“”)�”}”(Œ rawsource”Œ”Œchildren”]”(Œ translations”Œ LanguagesNode”“”)�”}”(hhh]”(hŒ pending_xref”“”)�”}”(hhh]”Œdocutils.nodes”ŒText”“”ŒChinese (Simplified)”…”�”}”Œparent”hsbaŒ attributes”}”(Œids”]”Œclasses”]”Œnames”]”Œdupnames”]”Œbackrefs”]”Œ refdomain”Œstd”Œreftype”Œdoc”Œ reftarget”Œ//translations/zh_CN/livepatch/module-elf-format”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)�”}”(hhh]”hŒChinese (Traditional)”…”�”}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ//translations/zh_TW/livepatch/module-elf-format”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒItalian”…”�”}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ//translations/it_IT/livepatch/module-elf-format”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒJapanese”…”�”}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ//translations/ja_JP/livepatch/module-elf-format”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒKorean”…”�”}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ//translations/ko_KR/livepatch/module-elf-format”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒPortuguese (Brazilian)”…”�”}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ//translations/pt_BR/livepatch/module-elf-format”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒSpanish”…”�”}”hh–sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ//translations/sp_SP/livepatch/module-elf-format”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒsection”“”)�”}”(hhh]”(hŒtitle”“”)�”}”(hŒLivepatch module ELF format”h]”hŒLivepatch module ELF format”…”�”}”(hh¼h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhh·h²hh³ŒI/var/lib/git/docbuild/linux/Documentation/livepatch/module-elf-format.rst”h´KubhŒ paragraph”“”)�”}”(hŒVThis document outlines the ELF format requirements that livepatch modules must follow.”h]”hŒVThis document outlines the ELF format requirements that livepatch modules must follow.”…”�”}”(hhÍh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Khh·h²hubhŒcomment”“”)�”}”(hŒTable of Contents”h]”hŒTable of Contents”…”�”}”hhÝsbah}”(h]”h ]”h"]”h$]”h&]”Œ xml:space”Œpreserve”uh1hÛhh·h²hh³hÊh´K ubhŒtopic”“”)�”}”(hhh]”hŒ bullet_list”“”)�”}”(hhh]”(hŒ list_item”“”)�”}”(hhh]”(hÌ)�”}”(hhh]”hŒ reference”“”)�”}”(hhh]”hŒ1. Background and motivation”…”�”}”(hjh²hh³Nh´Nubah}”(h]”Œid2”ah ]”h"]”h$]”h&]”Œrefid”Œbackground-and-motivation”uh1hÿhhüubah}”(h]”h ]”h"]”h$]”h&]”uh1hËhhùubhó)�”}”(hhh]”hø)�”}”(hhh]”hÌ)�”}”(hhh]”j)�”}”(hhh]”hŒ5Why does livepatch need to write its own relocations?”…”�”}”(hj h²hh³Nh´Nubah}”(h]”Œid3”ah ]”h"]”h$]”h&]”Œrefid”Œ4why-does-livepatch-need-to-write-its-own-relocations”uh1hÿhjubah}”(h]”h ]”h"]”h$]”h&]”uh1hËhjubah}”(h]”h ]”h"]”h$]”h&]”uh1h÷hjubah}”(h]”h ]”h"]”h$]”h&]”uh1hòhhùubeh}”(h]”h ]”h"]”h$]”h&]”uh1h÷hhôubhø)�”}”(hhh]”(hÌ)�”}”(hhh]”j)�”}”(hhh]”hŒ2. Livepatch modinfo field”…”�”}”(hjNh²hh³Nh´Nubah}”(h]”Œid4”ah ]”h"]”h$]”h&]”Œrefid”Œlivepatch-modinfo-field”uh1hÿhjKubah}”(h]”h ]”h"]”h$]”h&]”uh1hËhjHubhó)�”}”(hhh]”hø)�”}”(hhh]”hÌ)�”}”(hhh]”j)�”}”(hhh]”hŒExample:”…”�”}”(hjmh²hh³Nh´Nubah}”(h]”Œid5”ah ]”h"]”h$]”h&]”Œrefid”Œexample”uh1hÿhjjubah}”(h]”h ]”h"]”h$]”h&]”uh1hËhjgubah}”(h]”h ]”h"]”h$]”h&]”uh1h÷hjdubah}”(h]”h ]”h"]”h$]”h&]”uh1hòhjHubeh}”(h]”h ]”h"]”h$]”h&]”uh1h÷hhôubhø)�”}”(hhh]”hÌ)�”}”(hhh]”j)�”}”(hhh]”hŒ 3. Livepatch relocation sections”…”�”}”(hj›h²hh³Nh´Nubah}”(h]”Œid6”ah ]”h"]”h$]”h&]”Œrefid”Œlivepatch-relocation-sections”uh1hÿhj˜ubah}”(h]”h ]”h"]”h$]”h&]”uh1hËhj•ubah}”(h]”h ]”h"]”h$]”h&]”uh1h÷hhôubhø)�”}”(hhh]”(hÌ)�”}”(hhh]”j)�”}”(hhh]”hŒ'3.1 Livepatch relocation section format”…”�”}”(hj½h²hh³Nh´Nubah}”(h]”Œid7”ah ]”h"]”h$]”h&]”Œrefid”Œ#livepatch-relocation-section-format”uh1hÿhjºubah}”(h]”h ]”h"]”h$]”h&]”uh1hËhj·ubhó)�”}”(hhh]”hø)�”}”(hhh]”hÌ)�”}”(hhh]”j)�”}”(hhh]”hŒ Examples:”…”�”}”(hjÜh²hh³Nh´Nubah}”(h]”Œid8”ah ]”h"]”h$]”h&]”Œrefid”Œexamples”uh1hÿhjÙubah}”(h]”h ]”h"]”h$]”h&]”uh1hËhjÖubah}”(h]”h ]”h"]”h$]”h&]”uh1h÷hjÓubah}”(h]”h ]”h"]”h$]”h&]”uh1hòhj·ubeh}”(h]”h ]”h"]”h$]”h&]”uh1h÷hhôubhø)�”}”(hhh]”hÌ)�”}”(hhh]”j)�”}”(hhh]”hŒ4. Livepatch symbols”…”�”}”(hj h²hh³Nh´Nubah}”(h]”Œid9”ah ]”h"]”h$]”h&]”Œrefid”Œlivepatch-symbols”uh1hÿhjubah}”(h]”h ]”h"]”h$]”h&]”uh1hËhjubah}”(h]”h ]”h"]”h$]”h&]”uh1h÷hhôubhø)�”}”(hhh]”hÌ)�”}”(hhh]”j)�”}”(hhh]”hŒ'4.1 A livepatch module’s symbol table”…”�”}”(hj,h²hh³Nh´Nubah}”(h]”Œid10”ah ]”h"]”h$]”h&]”Œrefid”Œ!a-livepatch-module-s-symbol-table”uh1hÿhj)ubah}”(h]”h ]”h"]”h$]”h&]”uh1hËhj&ubah}”(h]”h ]”h"]”h$]”h&]”uh1h÷hhôubhø)�”}”(hhh]”(hÌ)�”}”(hhh]”j)�”}”(hhh]”hŒ4.2 Livepatch symbol format”…”�”}”(hjNh²hh³Nh´Nubah}”(h]”Œid11”ah ]”h"]”h$]”h&]”Œrefid”Œlivepatch-symbol-format”uh1hÿhjKubah}”(h]”h ]”h"]”h$]”h&]”uh1hËhjHubhó)�”}”(hhh]”hø)�”}”(hhh]”hÌ)�”}”(hhh]”j)�”}”(hhh]”hŒ Examples:”…”�”}”(hjmh²hh³Nh´Nubah}”(h]”Œid12”ah ]”h"]”h$]”h&]”Œrefid”Œid1”uh1hÿhjjubah}”(h]”h ]”h"]”h$]”h&]”uh1hËhjgubah}”(h]”h ]”h"]”h$]”h&]”uh1h÷hjdubah}”(h]”h ]”h"]”h$]”h&]”uh1hòhjHubeh}”(h]”h ]”h"]”h$]”h&]”uh1h÷hhôubhø)�”}”(hhh]”hÌ)�”}”(hhh]”j)�”}”(hhh]”hŒ&5. Symbol table and ELF section access”…”�”}”(hj›h²hh³Nh´Nubah}”(h]”Œid13”ah ]”h"]”h$]”h&]”Œrefid”Œ#symbol-table-and-elf-section-access”uh1hÿhj˜ubah}”(h]”h ]”h"]”h$]”h&]”uh1hËhj•ubah}”(h]”h ]”h"]”h$]”h&]”uh1h÷hhôubeh}”(h]”h ]”h"]”h$]”h&]”uh1hòhhïh²hh³Nh´Nubah}”(h]”Œcontents”ah ]”(Œcontents”Œlocal”eh"]”Œcontents”ah$]”h&]”uh1híh³hÊh´K hh·h²hubh¶)�”}”(hhh]”(h»)�”}”(hŒ1. Background and motivation”h]”hŒ1. Background and motivation”…”�”}”(hjÊh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefid”j uh1hºhjÇh²hh³hÊh´KubhÌ)�”}”(hX,Formerly, livepatch required separate architecture-specific code to write relocations. However, arch-specific code to write relocations already exists in the module loader, so this former approach produced redundant code. So, instead of duplicating code and re-implementing what the module loader can already do, livepatch leverages existing code in the module loader to perform the all the arch-specific relocation work. Specifically, livepatch reuses the apply_relocate_add() function in the module loader to write relocations. The patch module ELF format described in this document enables livepatch to be able to do this. The hope is that this will make livepatch more easily portable to other architectures and reduce the amount of arch-specific code required to port livepatch to a particular architecture.”h]”hX,Formerly, livepatch required separate architecture-specific code to write relocations. However, arch-specific code to write relocations already exists in the module loader, so this former approach produced redundant code. So, instead of duplicating code and re-implementing what the module loader can already do, livepatch leverages existing code in the module loader to perform the all the arch-specific relocation work. Specifically, livepatch reuses the apply_relocate_add() function in the module loader to write relocations. The patch module ELF format described in this document enables livepatch to be able to do this. The hope is that this will make livepatch more easily portable to other architectures and reduce the amount of arch-specific code required to port livepatch to a particular architecture.”…”�”}”(hjÙh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KhjÇh²hubhÌ)�”}”(hX¹Since apply_relocate_add() requires access to a module's section header table, symbol table, and relocation section indices, ELF information is preserved for livepatch modules (see section 5). Livepatch manages its own relocation sections and symbols, which are described in this document. The ELF constants used to mark livepatch symbols and relocation sections were selected from OS-specific ranges according to the definitions from glibc.”h]”hX»Since apply_relocate_add() requires access to a module’s section header table, symbol table, and relocation section indices, ELF information is preserved for livepatch modules (see section 5). Livepatch manages its own relocation sections and symbols, which are described in this document. The ELF constants used to mark livepatch symbols and relocation sections were selected from OS-specific ranges according to the definitions from glibc.”…”�”}”(hjçh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KhjÇh²hubh¶)�”}”(hhh]”(h»)�”}”(hŒ5Why does livepatch need to write its own relocations?”h]”hŒ5Why does livepatch need to write its own relocations?”…”�”}”(hjøh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”jØj)uh1hºhjõh²hh³hÊh´K%ubhÌ)�”}”(hXžA typical livepatch module contains patched versions of functions that can reference non-exported global symbols and non-included local symbols. Relocations referencing these types of symbols cannot be left in as-is since the kernel module loader cannot resolve them and will therefore reject the livepatch module. Furthermore, we cannot apply relocations that affect modules not yet loaded at patch module load time (e.g. a patch to a driver that is not loaded). Formerly, livepatch solved this problem by embedding special "dynrela" (dynamic rela) sections in the resulting patch module ELF output. Using these dynrela sections, livepatch could resolve symbols while taking into account its scope and what module the symbol belongs to, and then manually apply the dynamic relocations. However this approach required livepatch to supply arch-specific code in order to write these relocations. In the new format, livepatch manages its own SHT_RELA relocation sections in place of dynrela sections, and the symbols that the relas reference are special livepatch symbols (see section 2 and 3). The arch-specific livepatch relocation code is replaced by a call to apply_relocate_add().”h]”hX¢A typical livepatch module contains patched versions of functions that can reference non-exported global symbols and non-included local symbols. Relocations referencing these types of symbols cannot be left in as-is since the kernel module loader cannot resolve them and will therefore reject the livepatch module. Furthermore, we cannot apply relocations that affect modules not yet loaded at patch module load time (e.g. a patch to a driver that is not loaded). Formerly, livepatch solved this problem by embedding special “dynrelaâ€� (dynamic rela) sections in the resulting patch module ELF output. Using these dynrela sections, livepatch could resolve symbols while taking into account its scope and what module the symbol belongs to, and then manually apply the dynamic relocations. However this approach required livepatch to supply arch-specific code in order to write these relocations. In the new format, livepatch manages its own SHT_RELA relocation sections in place of dynrela sections, and the symbols that the relas reference are special livepatch symbols (see section 2 and 3). The arch-specific livepatch relocation code is replaced by a call to apply_relocate_add().”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K&hjõh²hubeh}”(h]”j/ah ]”h"]”Œ5why does livepatch need to write its own relocations?”ah$]”h&]”uh1hµhjÇh²hh³hÊh´K%ubeh}”(h]”jah ]”h"]”Œ1. background and motivation”ah$]”h&]”uh1hµhh·h²hh³hÊh´Kubh¶)�”}”(hhh]”(h»)�”}”(hŒ2. Livepatch modinfo field”h]”hŒ2. Livepatch modinfo field”…”�”}”(hj%h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”jØjWuh1hºhj"h²hh³hÊh´K9ubhÌ)�”}”(hŒ•Livepatch modules are required to have the "livepatch" modinfo attribute. See the sample livepatch module in samples/livepatch/ for how this is done.”h]”hŒ™Livepatch modules are required to have the “livepatchâ€� modinfo attribute. See the sample livepatch module in samples/livepatch/ for how this is done.”…”�”}”(hj3h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K;hj"h²hubhÌ)�”}”(hŒÕLivepatch modules can be identified by users by using the 'modinfo' command and looking for the presence of the "livepatch" field. This field is also used by the kernel module loader to identify livepatch modules.”h]”hŒÝLivepatch modules can be identified by users by using the ‘modinfo’ command and looking for the presence of the “livepatchâ€� field. This field is also used by the kernel module loader to identify livepatch modules.”…”�”}”(hjAh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K>hj"h²hubh¶)�”}”(hhh]”(h»)�”}”(hŒExample:”h]”hŒExample:”…”�”}”(hjRh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”jØjvuh1hºhjOh²hh³hÊh´KCubhÌ)�”}”(hŒ**Modinfo output:**”h]”hŒstrong”“”)�”}”(hjbh]”hŒModinfo output:”…”�”}”(hjfh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jdhj`ubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KEhjOh²hubhŒ literal_block”“”)�”}”(hŒ¸% modinfo livepatch-meminfo.ko filename: livepatch-meminfo.ko livepatch: Y license: GPL depends: vermagic: 4.3.0+ SMP mod_unload”h]”hŒ¸% modinfo livepatch-meminfo.ko filename: livepatch-meminfo.ko livepatch: Y license: GPL depends: vermagic: 4.3.0+ SMP mod_unload”…”�”}”hj{sbah}”(h]”h ]”h"]”h$]”h&]”hëhìuh1jyh³hÊh´KIhjOh²hubeh}”(h]”j|ah ]”h"]”Œexample:”ah$]”h&]”uh1hµhj"h²hh³hÊh´KCubeh}”(h]”j]ah ]”h"]”Œ2. livepatch modinfo field”ah$]”h&]”uh1hµhh·h²hh³hÊh´K9ubh¶)�”}”(hhh]”(h»)�”}”(hŒ 3. Livepatch relocation sections”h]”hŒ 3. Livepatch relocation sections”…”�”}”(hjšh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”jØj¤uh1hºhj—h²hh³hÊh´KQubhÌ)�”}”(hXHA livepatch module manages its own ELF relocation sections to apply relocations to modules as well as to the kernel (vmlinux) at the appropriate time. For example, if a patch module patches a driver that is not currently loaded, livepatch will apply the corresponding livepatch relocation section(s) to the driver once it loads.”h]”hXHA livepatch module manages its own ELF relocation sections to apply relocations to modules as well as to the kernel (vmlinux) at the appropriate time. For example, if a patch module patches a driver that is not currently loaded, livepatch will apply the corresponding livepatch relocation section(s) to the driver once it loads.”…”�”}”(hj¨h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KShj—h²hubhÌ)�”}”(hXEach "object" (e.g. vmlinux, or a module) within a patch module may have multiple livepatch relocation sections associated with it (e.g. patches to multiple functions within the same object). There is a 1-1 correspondence between a livepatch relocation section and the target section (usually the text section of a function) to which the relocation(s) apply. It is also possible for a livepatch module to have no livepatch relocation sections, as in the case of the sample livepatch module (see samples/livepatch).”h]”hXEach “objectâ€� (e.g. vmlinux, or a module) within a patch module may have multiple livepatch relocation sections associated with it (e.g. patches to multiple functions within the same object). There is a 1-1 correspondence between a livepatch relocation section and the target section (usually the text section of a function) to which the relocation(s) apply. It is also possible for a livepatch module to have no livepatch relocation sections, as in the case of the sample livepatch module (see samples/livepatch).”…”�”}”(hj¶h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KYhj—h²hubhÌ)�”}”(hXSince ELF information is preserved for livepatch modules (see Section 5), a livepatch relocation section can be applied simply by passing in the appropriate section index to apply_relocate_add(), which then uses it to access the relocation section and apply the relocations.”h]”hXSince ELF information is preserved for livepatch modules (see Section 5), a livepatch relocation section can be applied simply by passing in the appropriate section index to apply_relocate_add(), which then uses it to access the relocation section and apply the relocations.”…”�”}”(hjÄh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Kbhj—h²hubhÌ)�”}”(hŒÅEvery symbol referenced by a rela in a livepatch relocation section is a livepatch symbol. These must be resolved before livepatch can call apply_relocate_add(). See Section 3 for more information.”h]”hŒÅEvery symbol referenced by a rela in a livepatch relocation section is a livepatch symbol. These must be resolved before livepatch can call apply_relocate_add(). See Section 3 for more information.”…”�”}”(hjÒh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Kghj—h²hubeh}”(h]”jªah ]”h"]”Œ 3. livepatch relocation sections”ah$]”h&]”uh1hµhh·h²hh³hÊh´KQubh¶)�”}”(hhh]”(h»)�”}”(hŒ'3.1 Livepatch relocation section format”h]”hŒ'3.1 Livepatch relocation section format”…”�”}”(hjêh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”jØjÆuh1hºhjçh²hh³hÊh´KlubhÌ)�”}”(hX¼Livepatch relocation sections must be marked with the SHF_RELA_LIVEPATCH section flag. See include/uapi/linux/elf.h for the definition. The module loader recognizes this flag and will avoid applying those relocation sections at patch module load time. These sections must also be marked with SHF_ALLOC, so that the module loader doesn't discard them on module load (i.e. they will be copied into memory along with the other SHF_ALLOC sections).”h]”hX¾Livepatch relocation sections must be marked with the SHF_RELA_LIVEPATCH section flag. See include/uapi/linux/elf.h for the definition. The module loader recognizes this flag and will avoid applying those relocation sections at patch module load time. These sections must also be marked with SHF_ALLOC, so that the module loader doesn’t discard them on module load (i.e. they will be copied into memory along with the other SHF_ALLOC sections).”…”�”}”(hjøh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Knhjçh²hubhÌ)�”}”(hŒQThe name of a livepatch relocation section must conform to the following format::”h]”hŒPThe name of a livepatch relocation section must conform to the following format:”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Kuhjçh²hubjz)�”}”(hŒw.klp.rela.objname.section_name ^ ^^ ^ ^ ^ |________||_____| |__________| [A] [B] [C]”h]”hŒw.klp.rela.objname.section_name ^ ^^ ^ ^ ^ |________||_____| |__________| [A] [B] [C]”…”�”}”hjsbah}”(h]”h ]”h"]”h$]”h&]”hëhìuh1jyh³hÊh´Kxhjçh²hubhŒdefinition_list”“”)�”}”(hhh]”(hŒdefinition_list_item”“”)�”}”(hŒI[A] The relocation section name is prefixed with the string ".klp.rela." ”h]”(hŒterm”“”)�”}”(hŒ[A]”h]”hŒ[A]”…”�”}”(hj/h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j-h³hÊh´K~hj)ubhŒ definition”“”)�”}”(hhh]”hÌ)�”}”(hŒDThe relocation section name is prefixed with the string ".klp.rela."”h]”hŒHThe relocation section name is prefixed with the string “.klp.rela.â€�”…”�”}”(hjBh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K~hj?ubah}”(h]”h ]”h"]”h$]”h&]”uh1j=hj)ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j'h³hÊh´K~hj$ubj()�”}”(hŒŒ[B] The name of the object (i.e. "vmlinux" or name of module) to which the relocation section belongs follows immediately after the prefix. ”h]”(j.)�”}”(hŒ[B]”h]”hŒ[B]”…”�”}”(hj`h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j-h³hÊh´K‚hj\ubj>)�”}”(hhh]”hÌ)�”}”(hŒ‡The name of the object (i.e. "vmlinux" or name of module) to which the relocation section belongs follows immediately after the prefix.”h]”hŒ‹The name of the object (i.e. “vmlinuxâ€� or name of module) to which the relocation section belongs follows immediately after the prefix.”…”�”}”(hjqh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K�hjnubah}”(h]”h ]”h"]”h$]”h&]”uh1j=hj\ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j'h³hÊh´K‚hj$h²hubj()�”}”(hŒM[C] The actual name of the section to which this relocation section applies. ”h]”(j.)�”}”(hŒ[C]”h]”hŒ[C]”…”�”}”(hj�h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j-h³hÊh´K…hj‹ubj>)�”}”(hhh]”hÌ)�”}”(hŒHThe actual name of the section to which this relocation section applies.”h]”hŒHThe actual name of the section to which this relocation section applies.”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K…hj�ubah}”(h]”h ]”h"]”h$]”h&]”uh1j=hj‹ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j'h³hÊh´K…hj$h²hubeh}”(h]”h ]”h"]”h$]”h&]”uh1j"hjçh²hh³hÊh´Nubh¶)�”}”(hhh]”(h»)�”}”(hŒ Examples:”h]”hŒ Examples:”…”�”}”(hjÃh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”jØjåuh1hºhjÀh²hh³hÊh´KˆubhÌ)�”}”(hŒ'**Livepatch relocation section names:**”h]”je)�”}”(hjÓh]”hŒ#Livepatch relocation section names:”…”�”}”(hjÕh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jdhjÑubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KŠhjÀh²hubjz)�”}”(hŒL.klp.rela.ext4.text.ext4_attr_store .klp.rela.vmlinux.text.cmdline_proc_show”h]”hŒL.klp.rela.ext4.text.ext4_attr_store .klp.rela.vmlinux.text.cmdline_proc_show”…”�”}”hjèsbah}”(h]”h ]”h"]”h$]”h&]”hëhìuh1jyh³hÊh´KŽhjÀh²hubhÌ)�”}”(hŒd**`readelf --sections` output for a patch module that patches vmlinux and modules 9p, btrfs, ext4:**”h]”je)�”}”(hjøh]”hŒ``readelf --sections` output for a patch module that patches vmlinux and modules 9p, btrfs, ext4:”…”�”}”(hjúh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jdhjöubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K‘hjÀh²hubjz)�”}”(hX-Section Headers: [Nr] Name Type Address Off Size ES Flg Lk Inf Al [ snip ] [29] .klp.rela.9p.text.caches.show RELA 0000000000000000 002d58 0000c0 18 AIo 64 9 8 [30] .klp.rela.btrfs.text.btrfs.feature.attr.show RELA 0000000000000000 002e18 000060 18 AIo 64 11 8 [ snip ] [34] .klp.rela.ext4.text.ext4.attr.store RELA 0000000000000000 002fd8 0000d8 18 AIo 64 13 8 [35] .klp.rela.ext4.text.ext4.attr.show RELA 0000000000000000 0030b0 000150 18 AIo 64 15 8 [36] .klp.rela.vmlinux.text.cmdline.proc.show RELA 0000000000000000 003200 000018 18 AIo 64 17 8 [37] .klp.rela.vmlinux.text.meminfo.proc.show RELA 0000000000000000 003218 0000f0 18 AIo 64 19 8 [ snip ] ^ ^ | | [*] [*]”h]”hX-Section Headers: [Nr] Name Type Address Off Size ES Flg Lk Inf Al [ snip ] [29] .klp.rela.9p.text.caches.show RELA 0000000000000000 002d58 0000c0 18 AIo 64 9 8 [30] .klp.rela.btrfs.text.btrfs.feature.attr.show RELA 0000000000000000 002e18 000060 18 AIo 64 11 8 [ snip ] [34] .klp.rela.ext4.text.ext4.attr.store RELA 0000000000000000 002fd8 0000d8 18 AIo 64 13 8 [35] .klp.rela.ext4.text.ext4.attr.show RELA 0000000000000000 0030b0 000150 18 AIo 64 15 8 [36] .klp.rela.vmlinux.text.cmdline.proc.show RELA 0000000000000000 003200 000018 18 AIo 64 17 8 [37] .klp.rela.vmlinux.text.meminfo.proc.show RELA 0000000000000000 003218 0000f0 18 AIo 64 19 8 [ snip ] ^ ^ | | [*] [*]”…”�”}”hj sbah}”(h]”h ]”h"]”h$]”h&]”hëhìuh1jyh³hÊh´K–hjÀh²hubj#)�”}”(hhh]”j()�”}”(hX[*] Livepatch relocation sections are SHT_RELA sections but with a few special characteristics. Notice that they are marked SHF_ALLOC ("A") so that they will not be discarded when the module is loaded into memory, as well as with the SHF_RELA_LIVEPATCH flag ("o" - for OS-specific). ”h]”(j.)�”}”(hŒ[*]”h]”hŒ[*]”…”�”}”(hj"h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j-h³hÊh´K¨hjubj>)�”}”(hhh]”hÌ)�”}”(hXLivepatch relocation sections are SHT_RELA sections but with a few special characteristics. Notice that they are marked SHF_ALLOC ("A") so that they will not be discarded when the module is loaded into memory, as well as with the SHF_RELA_LIVEPATCH flag ("o" - for OS-specific).”h]”hXLivepatch relocation sections are SHT_RELA sections but with a few special characteristics. Notice that they are marked SHF_ALLOC (“Aâ€�) so that they will not be discarded when the module is loaded into memory, as well as with the SHF_RELA_LIVEPATCH flag (“oâ€� - for OS-specific).”…”�”}”(hj3h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K¥hj0ubah}”(h]”h ]”h"]”h$]”h&]”uh1j=hjubeh}”(h]”h ]”h"]”h$]”h&]”uh1j'h³hÊh´K¨hjubah}”(h]”h ]”h"]”h$]”h&]”uh1j"hjÀh²hh³hÊh´NubhÌ)�”}”(hŒ1**`readelf --relocs` output for a patch module:**”h]”je)�”}”(hjUh]”hŒ-`readelf --relocs` output for a patch module:”…”�”}”(hjWh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jdhjSubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KªhjÀh²hubjz)�”}”(hXjRelocation section '.klp.rela.btrfs.text.btrfs_feature_attr_show' at offset 0x2ba0 contains 4 entries: Offset Info Type Symbol's Value Symbol's Name + Addend 000000000000001f 0000005e00000002 R_X86_64_PC32 0000000000000000 .klp.sym.vmlinux.printk,0 - 4 0000000000000028 0000003d0000000b R_X86_64_32S 0000000000000000 .klp.sym.btrfs.btrfs_ktype,0 + 0 0000000000000036 0000003b00000002 R_X86_64_PC32 0000000000000000 .klp.sym.btrfs.can_modify_feature.isra.3,0 - 4 000000000000004c 0000004900000002 R_X86_64_PC32 0000000000000000 .klp.sym.vmlinux.snprintf,0 - 4 [ snip ] ^ | [*]”h]”hXjRelocation section '.klp.rela.btrfs.text.btrfs_feature_attr_show' at offset 0x2ba0 contains 4 entries: Offset Info Type Symbol's Value Symbol's Name + Addend 000000000000001f 0000005e00000002 R_X86_64_PC32 0000000000000000 .klp.sym.vmlinux.printk,0 - 4 0000000000000028 0000003d0000000b R_X86_64_32S 0000000000000000 .klp.sym.btrfs.btrfs_ktype,0 + 0 0000000000000036 0000003b00000002 R_X86_64_PC32 0000000000000000 .klp.sym.btrfs.can_modify_feature.isra.3,0 - 4 000000000000004c 0000004900000002 R_X86_64_PC32 0000000000000000 .klp.sym.vmlinux.snprintf,0 - 4 [ snip ] ^ | [*]”…”�”}”hjjsbah}”(h]”h ]”h"]”h$]”h&]”hëhìuh1jyh³hÊh´K®hjÀh²hubj#)�”}”(hhh]”j()�”}”(hŒC[*] Every symbol referenced by a relocation is a livepatch symbol. ”h]”(j.)�”}”(hŒ[*]”h]”hŒ[*]”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j-h³hÊh´K¹hj{ubj>)�”}”(hhh]”hÌ)�”}”(hŒ>Every symbol referenced by a relocation is a livepatch symbol.”h]”hŒ>Every symbol referenced by a relocation is a livepatch symbol.”…”�”}”(hj�h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K¹hj�ubah}”(h]”h ]”h"]”h$]”h&]”uh1j=hj{ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j'h³hÊh´K¹hjxubah}”(h]”h ]”h"]”h$]”h&]”uh1j"hjÀh²hh³hÊh´Nubeh}”(h]”jëah ]”h"]”h$]”Œ examples:”ah&]”uh1hµhjçh²hh³hÊh´KˆŒ referenced”Kubeh}”(h]”jÌah ]”h"]”Œ'3.1 livepatch relocation section format”ah$]”h&]”uh1hµhh·h²hh³hÊh´Klubh¶)�”}”(hhh]”(h»)�”}”(hŒ4. Livepatch symbols”h]”hŒ4. Livepatch symbols”…”�”}”(hjÂh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”jØjuh1hºhj¿h²hh³hÊh´K¼ubhÌ)�”}”(hX‰Livepatch symbols are symbols referred to by livepatch relocation sections. These are symbols accessed from new versions of functions for patched objects, whose addresses cannot be resolved by the module loader (because they are local or unexported global syms). Since the module loader only resolves exported syms, and not every symbol referenced by the new patched functions is exported, livepatch symbols were introduced. They are used also in cases where we cannot immediately know the address of a symbol when a patch module loads. For example, this is the case when livepatch patches a module that is not loaded yet. In this case, the relevant livepatch symbols are resolved simply when the target module loads. In any case, for any livepatch relocation section, all livepatch symbols referenced by that section must be resolved before livepatch can call apply_relocate_add() for that reloc section.”h]”hX‰Livepatch symbols are symbols referred to by livepatch relocation sections. These are symbols accessed from new versions of functions for patched objects, whose addresses cannot be resolved by the module loader (because they are local or unexported global syms). Since the module loader only resolves exported syms, and not every symbol referenced by the new patched functions is exported, livepatch symbols were introduced. They are used also in cases where we cannot immediately know the address of a symbol when a patch module loads. For example, this is the case when livepatch patches a module that is not loaded yet. In this case, the relevant livepatch symbols are resolved simply when the target module loads. In any case, for any livepatch relocation section, all livepatch symbols referenced by that section must be resolved before livepatch can call apply_relocate_add() for that reloc section.”…”�”}”(hjÐh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K¾hj¿h²hubhÌ)�”}”(hŒèLivepatch symbols must be marked with SHN_LIVEPATCH so that the module loader can identify and ignore them. Livepatch modules keep these symbols in their symbol tables, and the symbol table is made accessible through module->symtab.”h]”hŒèLivepatch symbols must be marked with SHN_LIVEPATCH so that the module loader can identify and ignore them. Livepatch modules keep these symbols in their symbol tables, and the symbol table is made accessible through module->symtab.”…”�”}”(hjÞh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KÌhj¿h²hubeh}”(h]”jah ]”h"]”Œ4. livepatch symbols”ah$]”h&]”uh1hµhh·h²hh³hÊh´K¼ubh¶)�”}”(hhh]”(h»)�”}”(hŒ%4.1 A livepatch module's symbol table”h]”hŒ'4.1 A livepatch module’s symbol table”…”�”}”(hjöh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”jØj5uh1hºhjóh²hh³hÊh´KÒubhÌ)�”}”(hXiNormally, a stripped down copy of a module's symbol table (containing only "core" symbols) is made available through module->symtab (See layout_symtab() in kernel/module/kallsyms.c). For livepatch modules, the symbol table copied into memory on module load must be exactly the same as the symbol table produced when the patch module was compiled. This is because the relocations in each livepatch relocation section refer to their respective symbols with their symbol indices, and the original symbol indices (and thus the symtab ordering) must be preserved in order for apply_relocate_add() to find the right symbol.”h]”hXoNormally, a stripped down copy of a module’s symbol table (containing only “coreâ€� symbols) is made available through module->symtab (See layout_symtab() in kernel/module/kallsyms.c). For livepatch modules, the symbol table copied into memory on module load must be exactly the same as the symbol table produced when the patch module was compiled. This is because the relocations in each livepatch relocation section refer to their respective symbols with their symbol indices, and the original symbol indices (and thus the symtab ordering) must be preserved in order for apply_relocate_add() to find the right symbol.”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KÓhjóh²hubhÌ)�”}”(hŒ@For example, take this particular rela from a livepatch module::”h]”hŒ?For example, take this particular rela from a livepatch module:”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KÜhjóh²hubjz)�”}”(hX1Relocation section '.klp.rela.btrfs.text.btrfs_feature_attr_show' at offset 0x2ba0 contains 4 entries: Offset Info Type Symbol's Value Symbol's Name + Addend 000000000000001f 0000005e00000002 R_X86_64_PC32 0000000000000000 .klp.sym.vmlinux.printk,0 - 4”h]”hX1Relocation section '.klp.rela.btrfs.text.btrfs_feature_attr_show' at offset 0x2ba0 contains 4 entries: Offset Info Type Symbol's Value Symbol's Name + Addend 000000000000001f 0000005e00000002 R_X86_64_PC32 0000000000000000 .klp.sym.vmlinux.printk,0 - 4”…”�”}”hj sbah}”(h]”h ]”h"]”h$]”h&]”hëhìuh1jyh³hÊh´KÞhjóh²hubhÌ)�”}”(hŒÂThis rela refers to the symbol '.klp.sym.vmlinux.printk,0', and the symbol index is encoded in 'Info'. Here its symbol index is 0x5e, which is 94 in decimal, which refers to the symbol index 94.”h]”hŒÊThis rela refers to the symbol ‘.klp.sym.vmlinux.printk,0’, and the symbol index is encoded in ‘Info’. Here its symbol index is 0x5e, which is 94 in decimal, which refers to the symbol index 94.”…”�”}”(hj.h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Kâhjóh²hubhÌ)�”}”(hŒcAnd in this patch module's corresponding symbol table, symbol index 94 refers to that very symbol::”h]”hŒdAnd in this patch module’s corresponding symbol table, symbol index 94 refers to that very symbol:”…”�”}”(hj<h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Kæhjóh²hubjz)�”}”(hŒi[ snip ] 94: 0000000000000000 0 NOTYPE GLOBAL DEFAULT OS [0xff20] .klp.sym.vmlinux.printk,0 [ snip ]”h]”hŒi[ snip ] 94: 0000000000000000 0 NOTYPE GLOBAL DEFAULT OS [0xff20] .klp.sym.vmlinux.printk,0 [ snip ]”…”�”}”hjJsbah}”(h]”h ]”h"]”h$]”h&]”hëhìuh1jyh³hÊh´Kéhjóh²hubeh}”(h]”j;ah ]”h"]”Œ%4.1 a livepatch module's symbol table”ah$]”h&]”uh1hµhh·h²hh³hÊh´KÒubh¶)�”}”(hhh]”(h»)�”}”(hŒ4.2 Livepatch symbol format”h]”hŒ4.2 Livepatch symbol format”…”�”}”(hjbh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”jØjWuh1hºhj_h²hh³hÊh´KîubhÌ)�”}”(hŒÎLivepatch symbols must have their section index marked as SHN_LIVEPATCH, so that the module loader can identify them and not attempt to resolve them. See include/uapi/linux/elf.h for the actual definitions.”h]”hŒÎLivepatch symbols must have their section index marked as SHN_LIVEPATCH, so that the module loader can identify them and not attempt to resolve them. See include/uapi/linux/elf.h for the actual definitions.”…”�”}”(hjph²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Kðhj_h²hubhÌ)�”}”(hŒ=Livepatch symbol names must conform to the following format::”h]”hŒ)�”}”(hhh]”hÌ)�”}”(hŒ7The symbol name is prefixed with the string ".klp.sym."”h]”hŒ;The symbol name is prefixed with the string “.klp.sym.â€�”…”�”}”(hj²h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Kühj¯ubah}”(h]”h ]”h"]”h$]”h&]”uh1j=hj�ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j'h³hÊh´Kühjšubj()�”}”(hŒ€[B] The name of the object (i.e. "vmlinux" or name of module) to which the symbol belongs follows immediately after the prefix. ”h]”(j.)�”}”(hŒ[B]”h]”hŒ[B]”…”�”}”(hjÐh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j-h³hÊh´MhjÌubj>)�”}”(hhh]”hÌ)�”}”(hŒ{The name of the object (i.e. "vmlinux" or name of module) to which the symbol belongs follows immediately after the prefix.”h]”hŒThe name of the object (i.e. “vmlinuxâ€� or name of module) to which the symbol belongs follows immediately after the prefix.”…”�”}”(hjáh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KÿhjÞubah}”(h]”h ]”h"]”h$]”h&]”uh1j=hjÌubeh}”(h]”h ]”h"]”h$]”h&]”uh1j'h³hÊh´Mhjšh²hubj()�”}”(hŒ#[C] The actual name of the symbol. ”h]”(j.)�”}”(hŒ[C]”h]”hŒ[C]”…”�”}”(hjÿh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j-h³hÊh´Mhjûubj>)�”}”(hhh]”hÌ)�”}”(hŒThe actual name of the symbol.”h]”hŒThe actual name of the symbol.”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Mhj ubah}”(h]”h ]”h"]”h$]”h&]”uh1j=hjûubeh}”(h]”h ]”h"]”h$]”h&]”uh1j'h³hÊh´Mhjšh²hubj()�”}”(hŒø[D] The position of the symbol in the object (as according to kallsyms) This is used to differentiate duplicate symbols within the same object. The symbol position is expressed numerically (0, 1, 2...). The symbol position of a unique symbol is 0. ”h]”(j.)�”}”(hŒ[D]”h]”hŒ[D]”…”�”}”(hj.h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j-h³hÊh´M hj*ubj>)�”}”(hhh]”hÌ)�”}”(hŒóThe position of the symbol in the object (as according to kallsyms) This is used to differentiate duplicate symbols within the same object. The symbol position is expressed numerically (0, 1, 2...). The symbol position of a unique symbol is 0.”h]”hŒóThe position of the symbol in the object (as according to kallsyms) This is used to differentiate duplicate symbols within the same object. The symbol position is expressed numerically (0, 1, 2...). The symbol position of a unique symbol is 0.”…”�”}”(hj?h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Mhj<ubah}”(h]”h ]”h"]”h$]”h&]”uh1j=hj*ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j'h³hÊh´M hjšh²hubeh}”(h]”h ]”h"]”h$]”h&]”uh1j"hj_h²hh³hÊh´Nubh¶)�”}”(hhh]”(h»)�”}”(hŒ Examples:”h]”hŒ Examples:”…”�”}”(hjbh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”jØjvuh1hºhj_h²hh³hÊh´M ubhÌ)�”}”(hŒ**Livepatch symbol names:**”h]”je)�”}”(hjrh]”hŒLivepatch symbol names:”…”�”}”(hjth²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jdhjpubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Mhj_h²hubjz)�”}”(hŒR.klp.sym.vmlinux.snprintf,0 .klp.sym.vmlinux.printk,0 .klp.sym.btrfs.btrfs_ktype,0”h]”hŒR.klp.sym.vmlinux.snprintf,0 .klp.sym.vmlinux.printk,0 .klp.sym.btrfs.btrfs_ktype,0”…”�”}”hj‡sbah}”(h]”h ]”h"]”h$]”h&]”hëhìuh1jyh³hÊh´Mhj_h²hubhÌ)�”}”(hŒ2**`readelf --symbols` output for a patch module:**”h]”je)�”}”(hj—h]”hŒ.`readelf --symbols` output for a patch module:”…”�”}”(hj™h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jdhj•ubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Mhj_h²hubjz)�”}”(hX°Symbol table '.symtab' contains 127 entries: Num: Value Size Type Bind Vis Ndx Name [ snip ] 73: 0000000000000000 0 NOTYPE GLOBAL DEFAULT OS [0xff20] .klp.sym.vmlinux.snprintf,0 74: 0000000000000000 0 NOTYPE GLOBAL DEFAULT OS [0xff20] .klp.sym.vmlinux.capable,0 75: 0000000000000000 0 NOTYPE GLOBAL DEFAULT OS [0xff20] .klp.sym.vmlinux.find_next_bit,0 76: 0000000000000000 0 NOTYPE GLOBAL DEFAULT OS [0xff20] .klp.sym.vmlinux.si_swapinfo,0 [ snip ] ^ | [*]”h]”hX°Symbol table '.symtab' contains 127 entries: Num: Value Size Type Bind Vis Ndx Name [ snip ] 73: 0000000000000000 0 NOTYPE GLOBAL DEFAULT OS [0xff20] .klp.sym.vmlinux.snprintf,0 74: 0000000000000000 0 NOTYPE GLOBAL DEFAULT OS [0xff20] .klp.sym.vmlinux.capable,0 75: 0000000000000000 0 NOTYPE GLOBAL DEFAULT OS [0xff20] .klp.sym.vmlinux.find_next_bit,0 76: 0000000000000000 0 NOTYPE GLOBAL DEFAULT OS [0xff20] .klp.sym.vmlinux.si_swapinfo,0 [ snip ] ^ | [*]”…”�”}”hj¬sbah}”(h]”h ]”h"]”h$]”h&]”hëhìuh1jyh³hÊh´Mhj_h²hubj#)�”}”(hhh]”j()�”}”(hŒm[*] Note that the 'Ndx' (Section index) for these symbols is SHN_LIVEPATCH (0xff20). "OS" means OS-specific. ”h]”(j.)�”}”(hŒ[*]”h]”hŒ[*]”…”�”}”(hjÁh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j-h³hÊh´M'hj½ubj>)�”}”(hhh]”hÌ)�”}”(hŒhNote that the 'Ndx' (Section index) for these symbols is SHN_LIVEPATCH (0xff20). "OS" means OS-specific.”h]”hŒpNote that the ‘Ndx’ (Section index) for these symbols is SHN_LIVEPATCH (0xff20). “OSâ€� means OS-specific.”…”�”}”(hjÒh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´M&hjÏubah}”(h]”h ]”h"]”h$]”h&]”uh1j=hj½ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j'h³hÊh´M'hjºubah}”(h]”h ]”h"]”h$]”h&]”uh1j"hj_h²hh³hÊh´Nubeh}”(h]”j|ah ]”h"]”h$]”jµah&]”uh1hµhj_h²hh³hÊh´M j·Kubeh}”(h]”j]ah ]”h"]”Œ4.2 livepatch symbol format”ah$]”h&]”uh1hµhh·h²hh³hÊh´Kîubh¶)�”}”(hhh]”(h»)�”}”(hŒ&5. Symbol table and ELF section access”h]”hŒ&5. Symbol table and ELF section access”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”jØj¤uh1hºhjÿh²hh³hÊh´M*ubhÌ)�”}”(hŒGA livepatch module's symbol table is accessible through module->symtab.”h]”hŒIA livepatch module’s symbol table is accessible through module->symtab.”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´M+hjÿh²hubhÌ)�”}”(hXgSince apply_relocate_add() requires access to a module's section headers, symbol table, and relocation section indices, ELF information is preserved for livepatch modules and is made accessible by the module loader through module->klp_info, which is a :c:type:`klp_modinfo` struct. When a livepatch module loads, this struct is filled in by the module loader.”h]”(hŒþSince apply_relocate_add() requires access to a module’s section headers, symbol table, and relocation section indices, ELF information is preserved for livepatch modules and is made accessible by the module loader through module->klp_info, which is a ”…”�”}”(hjh²hh³Nh´Nubh)�”}”(hŒ:c:type:`klp_modinfo`”h]”hŒliteral”“”)�”}”(hj(h]”hŒ klp_modinfo”…”�”}”(hj,h²hh³Nh´Nubah}”(h]”h ]”(Œxref”Œc”Œc-type”eh"]”h$]”h&]”uh1j*hj&ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”Œlivepatch/module-elf-format”Œ refdomain”j7Œreftype”Œtype”Œ refexplicit”‰Œrefwarn”‰Œ reftarget”Œ klp_modinfo”uh1hh³hÊh´M-hjubhŒV struct. When a livepatch module loads, this struct is filled in by the module loader.”…”�”}”(hjh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´M-hjÿh²hubeh}”(h]”jªah ]”h"]”Œ&5. symbol table and elf section access”ah$]”h&]”uh1hµhh·h²hh³hÊh´M*ubeh}”(h]”Œlivepatch-module-elf-format”ah ]”h"]”Œlivepatch module elf format”ah$]”h&]”uh1hµhhh²hh³hÊh´Kubeh}”(h]”h ]”h"]”h$]”h&]”Œsource”hÊuh1hŒcurrent_source”NŒ current_line”NŒsettings”Œdocutils.frontend”ŒValues”“”)�”}”(hºNŒ generator”NŒ datestamp”NŒ source_link”NŒ source_url”NŒ toc_backlinks”Œentry”Œfootnote_backlinks”KŒ sectnum_xform”KŒstrip_comments”NŒstrip_elements_with_classes”NŒ strip_classes”NŒ report_level”KŒ halt_level”KŒexit_status_level”KŒdebug”NŒwarning_stream”NŒ traceback”ˆŒinput_encoding”Œ utf-8-sig”Œinput_encoding_error_handler”Œstrict”Œoutput_encoding”Œutf-8”Œoutput_encoding_error_handler”j‡Œerror_encoding”Œutf-8”Œerror_encoding_error_handler”Œbackslashreplace”Œ language_code”Œen”Œrecord_dependencies”NŒconfig”NŒ id_prefix”hŒauto_id_prefix”Œid”Œ dump_settings”NŒdump_internals”NŒdump_transforms”NŒdump_pseudo_xml”NŒexpose_internals”NŒstrict_visitor”NŒ_disable_config”NŒ_source”hÊŒ _destination”NŒ _config_files”]”Œ7/var/lib/git/docbuild/linux/Documentation/docutils.conf”aŒfile_insertion_enabled”ˆŒ raw_enabled”KŒline_length_limit”M'Œpep_references”NŒ pep_base_url”Œhttps://peps.python.org/”Œpep_file_url_template”Œpep-%04d”Œrfc_references”NŒ rfc_base_url”Œ&https://datatracker.ietf.org/doc/html/”Œ tab_width”KŒtrim_footnote_reference_space”‰Œsyntax_highlight”Œlong”Œ smart_quotes”ˆŒsmartquotes_locales”]”Œcharacter_level_inline_markup”‰Œdoctitle_xform”‰Œ docinfo_xform”KŒsectsubtitle_xform”‰Œ image_loading”Œlink”Œembed_stylesheet”‰Œcloak_email_addresses”ˆŒsection_self_link”‰Œenv”NubŒreporter”NŒindirect_targets”]”Œsubstitution_defs”}”Œsubstitution_names”}”Œrefnames”}”Œrefids”}”Œnameids”}”(jaj^jÄj¿jjjj/j”j]j�j|jäjªj¼jÌŒ examples:”Njðjj\j;jüj]jYjªuŒ nametypes”}”(ja‰jĉj‰j‰j”‰j�‰jä‰j¼‰jˉjð‰j\‰jü‰jY‰uh}”(j^h·j¿hïjjÇj/jõj]j"j|jOjªj—jÌjçjëjÀjj¿j;jój]j_j|j_jªjÿj jj)j jWjNjvjmj¤j›jÆj½jåjÜjj j5j,jWjNjvjmj¤j›uŒ footnote_refs”}”Œ citation_refs”}”Œ autofootnotes”]”Œautofootnote_refs”]”Œsymbol_footnotes”]”Œsymbol_footnote_refs”]”Œ footnotes”]”Œ citations”]”Œautofootnote_start”KŒsymbol_footnote_start”KŒ id_counter”Œ collections”ŒCounter”“”}”j•K s…”R”Œparse_messages”]”hŒsystem_message”“”)�”}”(hhh]”hÌ)�”}”(hŒ,Duplicate implicit target name: "examples:".”h]”hŒ0Duplicate implicit target name: “examples:â€�.”…”�”}”(hjïh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËhjìubah}”(h]”h ]”h"]”h$]”h&]”j|aŒlevel”KŒtype”ŒINFO”Œsource”hÊŒline”M uh1jêhj_h²hh³hÊh´M ubaŒtransform_messages”]”Œ transformer”NŒ include_log”]”Œ decoration”Nh²hub.