• Petr Mladek's avatar
    ftrace/x86: BUG when ftrace recovery fails · 7f11f5ec
    Petr Mladek authored
    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.czSigned-off-by: default avatarPetr Mladek <pmladek@suse.cz>
    Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
    7f11f5ec
ftrace.c 18.1 KB