]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
ftrace/x86: BUG when ftrace recovery fails
authorPetr Mladek <pmladek@suse.cz>
Mon, 24 Feb 2014 16:12:22 +0000 (17:12 +0100)
committerSteven Rostedt <rostedt@goodmis.org>
Fri, 7 Mar 2014 15:06:16 +0000 (10:06 -0500)
commit7f11f5ecf4ae09815dc2de267c5e04d1de01d862
tree51014fbc43d559884d4c95d57d86b8c69426718c
parentcd21067f69240041d36e491ff5597e0217615465
ftrace/x86: BUG when ftrace recovery fails

Ftrace modifies function calls using Int3 breakpoints on x86.
The breakpoints are handled only when the patching is in progress.
If something goes wrong, there is a recovery code that removes
the breakpoints. If this fails, the system might get silently
rebooted when a remaining break is not handled or an invalid
instruction is proceed.

We should BUG() when the breakpoint could not be removed. Otherwise,
the system silently crashes when the function finishes the Int3
handler is disabled.

Note that we need to modify remove_breakpoint() to return non-zero
value only when there is an error. The return value was ignored before,
so it does not cause any troubles.

Link: http://lkml.kernel.org/r/1393258342-29978-4-git-send-email-pmladek@suse.cz
Signed-off-by: Petr Mladek <pmladek@suse.cz>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
arch/x86/kernel/ftrace.c