Skip to content

x86/kprobes: Remoev single-step trap from x86 kprobes

Masami Hiramatsu bpf lkml 1 version Applied

Status from this message: The following commit has been merged into the x86/core branch of tip:

Get series with b4
b4 am 161469871251.49483.9142858308048988638.stgit@devnote2

Versions newest first

  1. v1 Latest3 patches 3 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/3x86/kprobes: Retrieve correct opcode for group instructionarch/x86/kernel/kprobes/core.c+5 -10 replies
2/3x86/kprobes: Identify far indirect JMP correctlyarch/x86/kernel/kprobes/core.c+1 -20 replies
3/3x86/kprobes: Use int3 instead of debug trap for single-steparch/x86/include/asm/kprobes.h arch/x86/kernel/kprobes/core.c arch/x86/kernel/traps.c+353 -1880 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH -tip 0/3] x86/kprobes: Remoev single-step trap from x86 kprobes

Hi,

Here is a series of patches to remove the single-step debug trap from the x86 kprobe.

The first 2 patches ([1/3][2/3]) are bugfixes which I've sent recently;

https://lore.kernel.org/lkml/161425451732.93763.18329509061375062554.stgit@devnote2/

And [3/3] is actually the patch to remove single-step from kprobes. The RFC version is here;

https://lore.kernel.org/lkml/161460768474.430263.18425867006584111900.stgit@devnote2/

This uses int3 as Andy suggested instead of the debug trap, for removing the IRET which returns to kernel.
Some instructions must be emulated and some instructions becomes not able to be probed, but as far as I can see those are not rare case.

Thank you,

---

Masami Hiramatsu (3):
x86/kprobes: Retrieve correct opcode for group instruction x86/kprobes: Identify far indirect JMP correctly x86/kprobes: Use int3 instead of debug trap for single-step

 arch/x86/include/asm/kprobes.h |   21 +-
 arch/x86/kernel/kprobes/core.c |  524 ++++++++++++++++++++++++++--------------
 arch/x86/kernel/traps.c        |    3 
 3 files changed, 358 insertions(+), 190 deletions(-)

--
Masami Hiramatsu (Linaro) <[email protected]>