livepatch: kernel: add support for live patching
This commit introduces code for the live patching core. It implements an ftrace-based mechanism and kernel interface for doing live patching of kernel and kernel module functions. It represents the greatest common functionality set between kpatch and kgraft and can accept patches built using either method. This first version does not implement any consistency mechanism that ensures that old and new code do not run together. In practice, ~90% of CVEs are safe to apply in this way, since they simply add a conditional check. However, any function change that can not execute safely with the old version of the function can _not_ be safely applied in this version. [ jkosina@suse.cz: due to the number of contributions that got folded into this original patch from Seth Jennings, add SUSE's copyright as well, as discussed via e-mail ] Signed-off-by: NSeth Jennings <sjenning@redhat.com> Signed-off-by: NJosh Poimboeuf <jpoimboe@redhat.com> Reviewed-by: NMiroslav Benes <mbenes@suse.cz> Reviewed-by: NPetr Mladek <pmladek@suse.cz> Reviewed-by: NMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com> Signed-off-by: NMiroslav Benes <mbenes@suse.cz> Signed-off-by: NPetr Mladek <pmladek@suse.cz> Signed-off-by: NJiri Kosina <jkosina@suse.cz>
Showing
arch/x86/include/asm/livepatch.h
0 → 100644
arch/x86/kernel/livepatch.c
0 → 100644
include/linux/livepatch.h
0 → 100644
kernel/livepatch/Kconfig
0 → 100644
kernel/livepatch/Makefile
0 → 100644
kernel/livepatch/core.c
0 → 100644
想要评论请 注册 或 登录