diff options
author | Jessica Yu <jeyu@redhat.com> | 2016-08-18 02:58:29 +0200 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2016-08-18 23:41:55 +0200 |
commit | d4c3e6e1b193497da3a2ce495fb1db0243e41e37 (patch) | |
tree | 8d0307b2403b25fd7aa808a01e59d62d6f9fa202 /Documentation/livepatch | |
parent | livepatch: use arch_klp_init_object_loaded() to finish arch-specific tasks (diff) | |
download | linux-d4c3e6e1b193497da3a2ce495fb1db0243e41e37.tar.xz linux-d4c3e6e1b193497da3a2ce495fb1db0243e41e37.zip |
livepatch/x86: apply alternatives and paravirt patches after relocations
Implement arch_klp_init_object_loaded() for x86, which applies
alternatives/paravirt patches. This fixes the order in which relocations
and alternatives/paravirt patches are applied.
Previously, if a patch module had alternatives or paravirt patches,
these were applied first by the module loader before livepatch can apply
per-object relocations. The (buggy) sequence of events was:
(1) Load patch module
(2) Apply alternatives and paravirt patches to patch module
* Note that these are applied to the new functions in the patch module
(3) Apply per-object relocations to patch module when target module loads.
* This clobbers what was written in step 2
This lead to crashes and corruption in general, since livepatch would
overwrite or step on previously applied alternative/paravirt patches.
The correct sequence of events should be:
(1) Load patch module
(2) Apply per-object relocations to patch module
(3) Apply alternatives and paravirt patches to patch module
This is fixed by delaying paravirt/alternatives patching until after
relocations are applied. Any .altinstructions or .parainstructions
sections are prefixed with ".klp.arch.${objname}" and applied in
arch_klp_init_object_loaded().
Signed-off-by: Jessica Yu <jeyu@redhat.com>
Acked-by: Miroslav Benes <mbenes@suse.cz>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'Documentation/livepatch')
0 files changed, 0 insertions, 0 deletions