Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a3d66b5a authored by Linus Torvalds's avatar Linus Torvalds
Browse files
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
parents 319645ca e41b104c
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -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)