diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-10-07 15:02:24 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-10-07 15:02:24 -0400 |
commit | ddc4e6d232d6b625a5686ec1aafe42b9e0109a4c (patch) | |
tree | 53f865760ca450fdb1789377516053980d96a837 /Documentation | |
parent | bc75450cc3db3485db1e289fef8c1028ba38296a (diff) | |
parent | 2992ef29ae01af998399d55ed7c692a2505fb8af (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/livepatching
Pull livepatching updates from Jiri Kosina:
- fix for patching modules that contain .altinstructions or
.parainstructions sections, from Jessica Yu
- make TAINT_LIVEPATCH a per-module flag (so that it's immediately
clear which module caused the taint), from Josh Poimboeuf
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/livepatching:
livepatch/module: make TAINT_LIVEPATCH module-specific
Documentation: livepatch: add section about arch-specific code
livepatch/x86: apply alternatives and paravirt patches after relocations
livepatch: use arch_klp_init_object_loaded() to finish arch-specific tasks
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/livepatch/module-elf-format.txt | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/Documentation/livepatch/module-elf-format.txt b/Documentation/livepatch/module-elf-format.txt index eedbdcf8ba50..f21a5289a09c 100644 --- a/Documentation/livepatch/module-elf-format.txt +++ b/Documentation/livepatch/module-elf-format.txt | |||
@@ -25,7 +25,8 @@ Table of Contents | |||
25 | 3.3.2 Required name format | 25 | 3.3.2 Required name format |
26 | 3.3.3 Example livepatch symbol names | 26 | 3.3.3 Example livepatch symbol names |
27 | 3.3.4 Example `readelf --symbols` output | 27 | 3.3.4 Example `readelf --symbols` output |
28 | 4. Symbol table and Elf section access | 28 | 4. Architecture-specific sections |
29 | 5. Symbol table and Elf section access | ||
29 | 30 | ||
30 | ---------------------------- | 31 | ---------------------------- |
31 | 0. Background and motivation | 32 | 0. Background and motivation |
@@ -46,7 +47,7 @@ architecture. | |||
46 | 47 | ||
47 | Since apply_relocate_add() requires access to a module's section header | 48 | Since apply_relocate_add() requires access to a module's section header |
48 | table, symbol table, and relocation section indices, Elf information is | 49 | table, symbol table, and relocation section indices, Elf information is |
49 | preserved for livepatch modules (see section 4). Livepatch manages its own | 50 | preserved for livepatch modules (see section 5). Livepatch manages its own |
50 | relocation sections and symbols, which are described in this document. The | 51 | relocation sections and symbols, which are described in this document. The |
51 | Elf constants used to mark livepatch symbols and relocation sections were | 52 | Elf constants used to mark livepatch symbols and relocation sections were |
52 | selected from OS-specific ranges according to the definitions from glibc. | 53 | selected from OS-specific ranges according to the definitions from glibc. |
@@ -117,7 +118,7 @@ also possible for a livepatch module to have no livepatch relocation | |||
117 | sections, as in the case of the sample livepatch module (see | 118 | sections, as in the case of the sample livepatch module (see |
118 | samples/livepatch). | 119 | samples/livepatch). |
119 | 120 | ||
120 | Since Elf information is preserved for livepatch modules (see Section 4), a | 121 | Since Elf information is preserved for livepatch modules (see Section 5), a |
121 | livepatch relocation section can be applied simply by passing in the | 122 | livepatch relocation section can be applied simply by passing in the |
122 | appropriate section index to apply_relocate_add(), which then uses it to | 123 | appropriate section index to apply_relocate_add(), which then uses it to |
123 | access the relocation section and apply the relocations. | 124 | access the relocation section and apply the relocations. |
@@ -292,8 +293,19 @@ Symbol table '.symtab' contains 127 entries: | |||
292 | [*] Note that the 'Ndx' (Section index) for these symbols is SHN_LIVEPATCH (0xff20). | 293 | [*] Note that the 'Ndx' (Section index) for these symbols is SHN_LIVEPATCH (0xff20). |
293 | "OS" means OS-specific. | 294 | "OS" means OS-specific. |
294 | 295 | ||
296 | --------------------------------- | ||
297 | 4. Architecture-specific sections | ||
298 | --------------------------------- | ||
299 | Architectures may override arch_klp_init_object_loaded() to perform | ||
300 | additional arch-specific tasks when a target module loads, such as applying | ||
301 | arch-specific sections. On x86 for example, we must apply per-object | ||
302 | .altinstructions and .parainstructions sections when a target module loads. | ||
303 | These sections must be prefixed with ".klp.arch.$objname." so that they can | ||
304 | be easily identified when iterating through a patch module's Elf sections | ||
305 | (See arch/x86/kernel/livepatch.c for a complete example). | ||
306 | |||
295 | -------------------------------------- | 307 | -------------------------------------- |
296 | 4. Symbol table and Elf section access | 308 | 5. Symbol table and Elf section access |
297 | -------------------------------------- | 309 | -------------------------------------- |
298 | A livepatch module's symbol table is accessible through module->symtab. | 310 | A livepatch module's symbol table is accessible through module->symtab. |
299 | 311 | ||