Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

livepatch: kernel: add TAINT_LIVEPATCH

This adds a new taint flag to indicate when the kernel or a kernel
module has been live patched. This will provide a clean indication in
bug reports that live patching was used.

Additionally, if the crash occurs in a live patched function, the live
patch module will appear beside the patched function in the backtrace.

Signed-off-by: Seth Jennings <sjenning@redhat.com>
Acked-by: Josh Poimboeuf <jpoimboe@redhat.com>
Reviewed-by: Miroslav Benes <mbenes@suse.cz>
Reviewed-by: Petr Mladek <pmladek@suse.cz>
Reviewed-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>

authored by

Seth Jennings and committed by
Jiri Kosina
c5f45465 97bf6af1

+6
+2
Documentation/oops-tracing.txt
··· 270 270 271 271 15: 'L' if a soft lockup has previously occurred on the system. 272 272 273 + 16: 'K' if the kernel has been live patched. 274 + 273 275 The primary reason for the 'Tainted: ' string is to tell kernel 274 276 debuggers if this is a clean kernel or if anything unusual has 275 277 occurred. Tainting is permanent: even if an offending module is
+1
Documentation/sysctl/kernel.txt
··· 843 843 8192 - An unsigned module has been loaded in a kernel supporting module 844 844 signature. 845 845 16384 - A soft lockup has previously occurred on the system. 846 + 32768 - The kernel has been live patched. 846 847 847 848 ============================================================== 848 849
+1
include/linux/kernel.h
··· 471 471 #define TAINT_OOT_MODULE 12 472 472 #define TAINT_UNSIGNED_MODULE 13 473 473 #define TAINT_SOFTLOCKUP 14 474 + #define TAINT_LIVEPATCH 15 474 475 475 476 extern const char hex_asc[]; 476 477 #define hex_asc_lo(x) hex_asc[((x) & 0x0f)]
+2
kernel/panic.c
··· 226 226 { TAINT_OOT_MODULE, 'O', ' ' }, 227 227 { TAINT_UNSIGNED_MODULE, 'E', ' ' }, 228 228 { TAINT_SOFTLOCKUP, 'L', ' ' }, 229 + { TAINT_LIVEPATCH, 'K', ' ' }, 229 230 }; 230 231 231 232 /** ··· 247 246 * 'O' - Out-of-tree module has been loaded. 248 247 * 'E' - Unsigned module has been loaded. 249 248 * 'L' - A soft lockup has previously occurred. 249 + * 'K' - Kernel has been live patched. 250 250 * 251 251 * The string is overwritten by the next call to print_tainted(). 252 252 */