From 56645d346d198e88a4d06641a5e8cf3b5c5d6ee1 Mon Sep 17 00:00:00 2001 From: Josh Poimboeuf Date: Tue, 15 Apr 2014 08:22:36 -0500 Subject: [PATCH] kmod/core: taint kernel with TAINT_USER For now, taint with TAINT_USER when loading a patch module so that the user can always detect when a kpatch module has been previously loaded. Eventually we will want a dedicated TAINT_KPATCH flag in the kernel. --- kmod/core/core.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kmod/core/core.c b/kmod/core/core.c index 455e764..16c03d8 100644 --- a/kmod/core/core.c +++ b/kmod/core/core.c @@ -266,8 +266,11 @@ int kpatch_register(struct module *mod, struct kpatch_func *funcs, goto out; } - pr_notice("loaded patch module \"%s\"\n", mod->name); + /* TODO: need TAINT_KPATCH */ + pr_notice_once("tainting kernel with TAINT_USER\n"); + add_taint(TAINT_USER, LOCKDEP_STILL_OK); + pr_notice("loaded patch module \"%s\"\n", mod->name); out: up(&kpatch_mutex); return ret;