aboutsummaryrefslogtreecommitdiff
path: root/kernel/livepatch
diff options
context:
space:
mode:
authorSteven Rostedt (VMware) <[email protected]>2020-11-05 21:32:42 -0500
committerSteven Rostedt (VMware) <[email protected]>2020-11-06 08:41:47 -0500
commit4b750b573c5b3ee10e33c1573eaa94a9dad62f19 (patch)
treeb889901b1bb61cacd0d4503881412ebfc834bae8 /kernel/livepatch
parent13f3ea9a2c829f28610bb8772a8b9c328412930e (diff)
livepatch: Trigger WARNING if livepatch function fails due to recursion
If for some reason a function is called that triggers the recursion detection of live patching, trigger a warning. By not executing the live patch code, it is possible that the old unpatched function will be called placing the system into an unknown state. Link: https://lore.kernel.org/r/20201029145709.GD16774@alley Link: https://lkml.kernel.org/r/[email protected] Cc: Masami Hiramatsu <[email protected]> Cc: Andrew Morton <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Josh Poimboeuf <[email protected]> Cc: Jiri Kosina <[email protected]> Cc: Joe Lawrence <[email protected]> Cc: [email protected] Suggested-by: Miroslav Benes <[email protected]> Reviewed-by: Petr Mladek <[email protected]> Acked-by: Miroslav Benes <[email protected]> Signed-off-by: Steven Rostedt (VMware) <[email protected]>
Diffstat (limited to 'kernel/livepatch')
-rw-r--r--kernel/livepatch/patch.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/livepatch/patch.c b/kernel/livepatch/patch.c
index 6c0164d24bbd..15480bf3ce88 100644
--- a/kernel/livepatch/patch.c
+++ b/kernel/livepatch/patch.c
@@ -50,7 +50,7 @@ static void notrace klp_ftrace_handler(unsigned long ip,
ops = container_of(fops, struct klp_ops, fops);
bit = ftrace_test_recursion_trylock();
- if (bit < 0)
+ if (WARN_ON_ONCE(bit < 0))
return;
/*
* A variant of synchronize_rcu() is used to allow patching functions