linux/kernel/livepatch
Petr Mladek 19514910d0 livepatch: Change unsigned long old_addr -> void *old_func in struct klp_func
The address of the to be patched function and new function is stored
in struct klp_func as:

	void *new_func;
	unsigned long old_addr;

The different naming scheme and type are derived from the way
the addresses are set. @old_addr is assigned at runtime using
kallsyms-based search. @new_func is statically initialized,
for example:

  static struct klp_func funcs[] = {
	{
		.old_name = "cmdline_proc_show",
		.new_func = livepatch_cmdline_proc_show,
	}, { }
  };

This patch changes unsigned long old_addr -> void *old_func. It removes
some confusion when these address are later used in the code. It is
motivated by a followup patch that adds special NOP struct klp_func
where we want to assign func->new_func = func->old_addr respectively
func->new_func = func->old_func.

This patch does not modify the existing behavior.

Suggested-by: Josh Poimboeuf <jpoimboe@redhat.com>
Signed-off-by: Petr Mladek <pmladek@suse.com>
Acked-by: Miroslav Benes <mbenes@suse.cz>
Acked-by: Joe Lawrence <joe.lawrence@redhat.com>
Acked-by: Alice Ferrazzi <alice.ferrazzi@gmail.com>
Acked-by: Josh Poimboeuf <jpoimboe@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2019-01-11 20:51:23 +01:00
..
core.c livepatch: Change unsigned long old_addr -> void *old_func in struct klp_func 2019-01-11 20:51:23 +01:00
core.h Merge branch 'for-linus' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/jikos/livepatching 2017-11-15 10:21:58 -08:00
Kconfig livepatch: Make livepatch dependent on !TRIM_UNUSED_KSYMS 2017-05-27 00:27:37 +02:00
Makefile livepatch: introduce shadow variable API 2017-09-14 23:06:12 +02:00
patch.c livepatch: Change unsigned long old_addr -> void *old_func in struct klp_func 2019-01-11 20:51:23 +01:00
patch.h livepatch: Change unsigned long old_addr -> void *old_func in struct klp_func 2019-01-11 20:51:23 +01:00
shadow.c livepatch: Allow to call a custom callback when freeing shadow variables 2018-04-17 13:42:48 +02:00
transition.c livepatch: Change unsigned long old_addr -> void *old_func in struct klp_func 2019-01-11 20:51:23 +01:00
transition.h livepatch: force transition to finish 2017-12-07 13:21:35 +01:00