LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH v2 0/4] arm64: kprobes: Fix some bugs in arm64 kprobes 
@ 2019-07-22  7:48 Masami Hiramatsu
  2019-07-22  7:48 ` [PATCH v2 1/4] arm64: kprobes: Recover pstate.D in single-step exception handler Masami Hiramatsu
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Masami Hiramatsu @ 2019-07-22  7:48 UTC (permalink / raw)
  To: Catalin Marinas, Will Deacon
  Cc: mhiramat, linux-arm-kernel, linux-kernel, Naresh Kamboju,
	Dan Rue, Matt Hart, Anders Roxell, Daniel Diaz

Hi,

Here are the v2 patches which fixes kprobe bugs on arm64.

Naresh reported that recently ftracetest crashes kernel, and I found
there are 3 different bugs around the crash. In v1 thread, we found
one another bug of RCU and debug exception.

- Kprobes on arm64 doesn't recover pstate.D mask after single stepping.
  This causes a real kernel crash if a kprobe is unexpectedly nested.
- Some symbols which are called from blacklisted function, are not
  blacklisted.
- Debug exception is not visible to RCU, thus rcu_read_lock() cause
  a warning inside it.
- Debug exception handlers on arm64 is using rcu_read_lock(), but
  that is not needed because interrupts are disabled.

This series includes fixes for above bugs.

Thank you,

---

Masami Hiramatsu (4):
      arm64: kprobes: Recover pstate.D in single-step exception handler
      arm64: unwind: Prohibit probing on return_address()
      arm64: Make debug exception handlers visible from RCU
      arm64: Remove unneeded rcu_read_lock from debug handlers


 arch/arm64/kernel/debug-monitors.c |   14 +++++++-----
 arch/arm64/kernel/probes/kprobes.c |   41 ++++++------------------------------
 arch/arm64/kernel/return_address.c |    4 +++-
 arch/arm64/kernel/stacktrace.c     |    3 +++
 arch/arm64/mm/fault.c              |   40 +++++++++++++++++++++++++++++++++++
 5 files changed, 61 insertions(+), 41 deletions(-)

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

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

end of thread, other threads:[~2019-07-24 13:09 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-22  7:48 [PATCH v2 0/4] arm64: kprobes: Fix some bugs in arm64 kprobes Masami Hiramatsu
2019-07-22  7:48 ` [PATCH v2 1/4] arm64: kprobes: Recover pstate.D in single-step exception handler Masami Hiramatsu
2019-07-23 16:03   ` James Morse
2019-07-24 13:09     ` Masami Hiramatsu
2019-07-22  7:48 ` [PATCH v2 2/4] arm64: unwind: Prohibit probing on return_address() Masami Hiramatsu
2019-07-23 16:04   ` James Morse
2019-07-24  7:39     ` Masami Hiramatsu
2019-07-22  7:48 ` [PATCH v2 3/4] arm64: Make debug exception handlers visible from RCU Masami Hiramatsu
2019-07-22 12:07   ` Paul E. McKenney
2019-07-23 17:07   ` James Morse
2019-07-24 11:47     ` Masami Hiramatsu
2019-07-22  7:49 ` [PATCH v2 4/4] arm64: Remove unneeded rcu_read_lock from debug handlers Masami Hiramatsu
2019-07-22 12:07   ` Paul E. McKenney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).