Skip to content

uprobes/x86: fix the handling of relative jmp's/call's

Oleg Nesterov lkml 3 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest15 patches 0 repliesNew
  2. v2 RFC6 patches 11 repliesSuperseded
  3. v1 RFC6 patches 32 repliesSuperseded

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/15uprobes: Kill UPROBE_SKIP_SSTEP and can_skip_sstep()kernel/events/uprobes.c+2 -210 replies
2/15uprobes/x86: Fold prepare_fixups() into arch_uprobe_analyze_insn()arch/x86/kernel/uprobes.c+47 -630 replies
3/15uprobes/x86: Kill the "ia32_compat" check in handle_riprel_insn(), remove "mm" argarch/x86/kernel/uprobes.c+3 -70 replies
4/15uprobes/x86: Gather "riprel" functions togetherarch/x86/kernel/uprobes.c+53 -650 replies
5/15uprobes/x86: move the UPROBE_FIX_{RIP,IP,CALL} code at the end of pre/post hooksarch/x86/kernel/uprobes.c+14 -160 replies
6/15uprobes/x86: Introduce uprobe_xol_ops and arch_uprobe->opsarch/x86/include/asm/uprobes.h arch/x86/kernel/uprobes.c+74 -400 replies
7/15uprobes/x86: Conditionalize the usage of handle_riprel_insn()arch/x86/kernel/uprobes.c+2 -40 replies
8/15uprobes/x86: Send SIGILL if arch_uprobe_post_xol() failsarch/x86/kernel/uprobes.c kernel/events/uprobes.c+19 -50 replies
9/15uprobes/x86: Teach arch_uprobe_post_xol() to restart if possiblearch/x86/kernel/uprobes.c+16 -40 replies
10/15uprobes/x86: Introduce sizeof_long(), cleanup adjust_ret_addr() and arch_uretprobe_hijack_return_addr()arch/x86/kernel/uprobes.c+15 -220 replies
11/15uprobes/x86: Emulate unconditional relative jmp'sarch/x86/include/asm/uprobes.h arch/x86/kernel/uprobes.c+45 -10 replies
12/15uprobes/x86: Emulate nop's using ops->emulate()arch/x86/kernel/uprobes.c+1 -190 replies
13/15uprobes/x86: Emulate relative call'sarch/x86/include/asm/uprobes.h arch/x86/kernel/uprobes.c+71 -100 replies
14/15uprobes/x86: Emulate relative conditional "short" jmp'sarch/x86/kernel/uprobes.c+55 -20 replies
15/15uprobes/x86: Emulate relative conditional "near" jmp'sarch/x86/kernel/uprobes.c+8 -00 replies

Reviews trailers per patch

All 15 patches have a Reviewed-by or Acked-by.

PatchMasami HiramatsuJim KenistonSrikar DronamrajuDavid A. Long
1/15R-b R-b A-b R-b
2/15R-b R-b A-b
3/15R-b R-b A-b
4/15R-b R-b
5/15R-b R-b A-b
6/15R-b R-b
7/15R-b R-b
8/15R-b R-b
9/15R-b R-b
10/15R-b
11/15R-b
12/15R-b
13/15R-b
14/15R-b
15/15R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v3 thread

Cover letter [PATCH v3 00/15] uprobes/x86: fix the handling of relative jmp's/call's

Hello.

OK, let me resend everything. This is what I am going to add to my tree and ask Ingo to pull. I am still testing this all, seems to work so far.

Changes:

01-09: No changes, added the acks from Masami.

09-15: Updated the changelogs, the comments in 13/15, plus the
following renames:

- s/ttt/branch/

- s/disp/offs/

- s/_clear_displacement/_clear_offset/

No changes in compiled code, I preserved the acks from Jim.

Quoted 1 line

From 13/15:

Note: as Denys Vlasenko pointed out, amd and intel treat "callw" (0x66 0xe8) differently. This patch relies on lib/insn.c and thus implements the intel's
behaviour: 0x66 is simply ignored. Fortunately nothing sane should ever use this insn, so we postpone the fix until we decide what should we do; emulate or not, support or not, etc.

Yes. Lets discuss (and fix?) this separately, I'll write another email.

Any objections?

Oleg.

 arch/x86/include/asm/uprobes.h |   16 +-
 arch/x86/kernel/uprobes.c      |  551 +++++++++++++++++++++++++---------------
 kernel/events/uprobes.c        |   31 +--
 3 files changed, 372 insertions(+), 226 deletions(-)