All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 tip/master 0/3] kprobes/x86: retpoline: Fix kprobes for retpoline
@ 2018-01-18 12:00 Masami Hiramatsu
  2018-01-18 12:01 ` [PATCH v1 tip/master 1/3] retpoline: Introduce start/end markers of indirect thunk Masami Hiramatsu
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Masami Hiramatsu @ 2018-01-18 12:00 UTC (permalink / raw)
  To: Ingo Molnar, David Woodhouse
  Cc: Masami Hiramatsu, linux-kernel, Andi Kleen, Greg Kroah-Hartman,
	Arjan van de Ven, Peter Zijlstra, Ananth N Mavinakayanahalli,
	Thomas Gleixner, H . Peter Anvin

Hi,

This is a series of patches 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.

Side effect: [1/3] will move __x86_indirect_thunk_* functions
in kernel text area. Of course those functions were in the
.text area, but placed in right after _etext. This just moves
it right before the _etext.

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        |   35 ++++++++++++++++++++++++++++++++++
 arch/x86/lib/retpoline.S             |    3 ++-
 4 files changed, 62 insertions(+), 2 deletions(-)

--
Masami Hiramatsu (Linaro) <mhiramat@kernel.org>

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2018-01-18 18:50 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-18 12:00 [PATCH v1 tip/master 0/3] kprobes/x86: retpoline: Fix kprobes for retpoline Masami Hiramatsu
2018-01-18 12:01 ` [PATCH v1 tip/master 1/3] retpoline: Introduce start/end markers of indirect thunk Masami Hiramatsu
2018-01-18 12:06   ` Woodhouse, David
2018-01-18 15:34     ` Masami Hiramatsu
2018-01-18 12:01 ` [PATCH v1 tip/master 2/3] kprobes/x86: Blacklist indirect thunk functions for kprobes Masami Hiramatsu
2018-01-18 12:02 ` [PATCH v1 tip/master 3/3] kprobes/x86: Disable optimizing on the function jumps to indirect thunk Masami Hiramatsu
2018-01-18 13:01 ` [PATCH v1 tip/master 0/3] kprobes/x86: retpoline: Fix kprobes for retpoline Andi Kleen
2018-01-18 13:03   ` David Woodhouse
2018-01-18 18:50     ` Andi Kleen
2018-01-18 15:36   ` Masami Hiramatsu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.