Skip to content

kprobes/x86: retpoline: Fix kprobes for retpoline

Masami Hiramatsu lkml stable 2 versions In review

Get series with b4
b4 am 151629203720.10241.17490679760505352230.stgit@devbox

Versions newest first · linked by author and title

  1. v2 Latest3 patches 1 replyIn review
  2. v13 patches 6 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3retpoline: Introduce start/end markers of indirect thunkarch/x86/include/asm/nospec-branch.h arch/x86/kernel/vmlinux.lds.S arch/x86/lib/retpoline.S+10 -10 replies
2/3kprobes/x86: Blacklist indirect thunk functions for kprobesarch/x86/lib/retpoline.S+2 -10 replies
3/3kprobes/x86: Disable optimizing on the function jumps to indirect thunkarch/x86/kernel/kprobes/opt.c+22 -10 replies

Reviews trailers per patch

None of the 3 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchDavid Woodhouse
SeriesA-b
1/3
2/3
3/3

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 tip/master 0/3] kprobes/x86: retpoline: Fix kprobes for retpoline

Hi,

This is the 2nd version of the series to fix kprobes issues on the kernel with CONFIG_RETPOLINE=y.

- [1/3]: This introduces __x86_indirect_thunk_* boundary symbols so that kprobes easily identify those functions.
- [2/3]: Mark __x86_indirect_thunk_* as blacklisted function for kprobes, since it can be called from other blacklisted functions.
- [3/3]: Check jmp instructions in the probe target function whether it jumps into the __x86_indirect_thunk_*, because it is equal to an indirect jump instruction.

In this version, just [1/3] has been changed according to David Woodhouse's comment.

[1/3]: Consolidate .text.__x86.indirect_thunk.* sections
to .text.__x86.indirect_thunk section.

Thank you,

---

Masami Hiramatsu (3):
retpoline: Introduce start/end markers of indirect thunk kprobes/x86: Blacklist indirect thunk functions for kprobes kprobes/x86: Disable optimizing on the function jumps to indirect thunk

 arch/x86/include/asm/nospec-branch.h |    3 +++
 arch/x86/kernel/kprobes/opt.c        |   23 ++++++++++++++++++++++-
 arch/x86/kernel/vmlinux.lds.S        |    6 ++++++
 arch/x86/lib/retpoline.S             |    5 +++--
 4 files changed, 34 insertions(+), 3 deletions(-)

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