]> git.baikalelectronics.ru Git - kernel.git/commit
livepatch: introduce shadow variable API
authorJoe Lawrence <joe.lawrence@redhat.com>
Thu, 31 Aug 2017 20:37:41 +0000 (16:37 -0400)
committerJiri Kosina <jkosina@suse.cz>
Thu, 14 Sep 2017 21:06:12 +0000 (23:06 +0200)
commit5278cb2b3c28a852aa0b10ed4f5510cdf605c796
treec3dd63d08e743a63936c24949b456d4522003022
parent7a719529a67f447ced36333f0ea90150a5b5d3c4
livepatch: introduce shadow variable API

Add exported API for livepatch modules:

  klp_shadow_get()
  klp_shadow_alloc()
  klp_shadow_get_or_alloc()
  klp_shadow_free()
  klp_shadow_free_all()

that implement "shadow" variables, which allow callers to associate new
shadow fields to existing data structures.  This is intended to be used
by livepatch modules seeking to emulate additions to data structure
definitions.

See Documentation/livepatch/shadow-vars.txt for a summary of the new
shadow variable API, including a few common use cases.

See samples/livepatch/livepatch-shadow-* for example modules that
demonstrate shadow variables.

[jkosina@suse.cz: fix __klp_shadow_get_or_alloc() comment as spotted by
 Josh]
Signed-off-by: Joe Lawrence <joe.lawrence@redhat.com>
Acked-by: Josh Poimboeuf <jpoimboe@redhat.com>
Acked-by: Miroslav Benes <mbenes@suse.cz>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Documentation/livepatch/shadow-vars.txt [new file with mode: 0644]
include/linux/livepatch.h
kernel/livepatch/Makefile
kernel/livepatch/shadow.c [new file with mode: 0644]
samples/Kconfig
samples/livepatch/Makefile
samples/livepatch/livepatch-shadow-fix1.c [new file with mode: 0644]
samples/livepatch/livepatch-shadow-fix2.c [new file with mode: 0644]
samples/livepatch/livepatch-shadow-mod.c [new file with mode: 0644]