Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/git/jikos/livepatching

Pull livepatching fix from Jiri Kosina:
 "A fix for module handling in case kASLR has been enabled, from Zhou
  Chengming"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/livepatching:
  livepatch: x86: fix relocation computation with kASLR
  • Loading branch information
Linus Torvalds committed Nov 19, 2015
2 parents 319645c + e41b104 commit a3d66b5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions kernel/livepatch/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,12 @@ static int klp_write_object_relocations(struct module *pmod,

for (reloc = obj->relocs; reloc->name; reloc++) {
if (!klp_is_module(obj)) {

#if defined(CONFIG_RANDOMIZE_BASE)
/* If KASLR has been enabled, adjust old value accordingly */
if (kaslr_enabled())
reloc->val += kaslr_offset();
#endif
ret = klp_verify_vmlinux_symbol(reloc->name,
reloc->val);
if (ret)
Expand Down

0 comments on commit a3d66b5

Please sign in to comment.