[PATCH v3 0/2] kprobes/x86: Fix up interaction between kprobes code recovery and ftrace

From: Petr Mladek
Date: Fri Feb 20 2015 - 09:07:13 EST


The code affected by ftrace was not properly recovered in Kprobe checks.
Also the address returned by ftrace can be used for a consistency check.

This version is based on the feedback for the separate patches, see
https://lkml.org/lkml/2015/2/20/91 and
https://lkml.org/lkml/2015/2/20/90


Changes against v2:

+ avoid using MCOUNT_INSN_SIZE that is available only with
CONFIG_FUNCTION_TRACER enabled

+ use WARN_ON() instead of BUG_ON() and correctly handle the
situation when Kprobe is not able to recover the code


Changes against v1:

+ always use 5-byte NOP for ftrace location
+ fix indentation of the touched comment

Petr Mladek (2):
kprobes/x86: Use 5-byte NOP when the code might be modified by ftrace
kprobes/x86: Check for invalid ftrace location in
__recover_probed_insn()

arch/x86/kernel/kprobes/core.c | 54 +++++++++++++++++++++++++++++++-----------
arch/x86/kernel/kprobes/opt.c | 2 ++
2 files changed, 42 insertions(+), 14 deletions(-)

--
1.8.5.6

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/