From: Masami Hiramatsu <mhiramat@kernel.org>
To: linux-kernel@vger.kernel.org, Peter Zijlstra <peterz@infradead.org>
Cc: Eddy Wu <Eddy_Wu@trendmicro.com>,
x86@kernel.org, "David S . Miller" <davem@davemloft.net>,
Steven Rostedt <rostedt@goodmis.org>,
Ingo Molnar <mingo@redhat.com>,
"Naveen N . Rao" <naveen.n.rao@linux.ibm.com>,
Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>,
linux-arch@vger.kernel.org
Subject: [PATCH v2 00/15] kprobes: Unify kretprobe trampoline handlers
Date: Thu, 27 Aug 2020 20:35:18 +0900 [thread overview]
Message-ID: <159852811819.707944.12798182250041968537.stgit@devnote2> (raw)
Hi,
Here is the 2nd version of the series to unify the kretprobe trampoline handler
implementation across all architectures which are currently kprobes supported.
Previous version is here;
https://lkml.kernel.org/r/159844957216.510284.17683703701627367133.stgit@devnote2
This series removes the in_nmi() check from pre_kretprobe_handler() since we
can avoid double-lock deadlock from NMI by kprobe_busy_begin/end().
In this version, I also add a patch to use kfree_rcu() for freeing kretprobe
instance objects so that we don't call kfree() in NMI context directly.
The unified generic kretprobe trampoline handler is based on x86 code, which
already support frame-pointer checker. The checker is enabled on arm and arm64
too because I can test it. For other architecutres, currently the checker
is not enabled. If someone wants to enable it, please set the correct
frame pointer to ri->fp and pass it to kretprobe_trampoline_handler() as the
3rd parameter, instead of NULL.
Thank you,
---
Masami Hiramatsu (15):
kprobes: Add generic kretprobe trampoline handler
x86/kprobes: Use generic kretprobe trampoline handler
arm: kprobes: Use generic kretprobe trampoline handler
arm64: kprobes: Use generic kretprobe trampoline handler
arc: kprobes: Use generic kretprobe trampoline handler
csky: kprobes: Use generic kretprobe trampoline handler
ia64: kprobes: Use generic kretprobe trampoline handler
mips: kprobes: Use generic kretprobe trampoline handler
parisc: kprobes: Use generic kretprobe trampoline handler
powerpc: kprobes: Use generic kretprobe trampoline handler
s390: kprobes: Use generic kretprobe trampoline handler
sh: kprobes: Use generic kretprobe trampoline handler
sparc: kprobes: Use generic kretprobe trampoline handler
kprobes: Remove NMI context check
kprobes: Free kretprobe_instance with rcu callback
arch/arc/kernel/kprobes.c | 55 +---------------
arch/arm/probes/kprobes/core.c | 79 +----------------------
arch/arm64/kernel/probes/kprobes.c | 79 +----------------------
arch/csky/kernel/probes/kprobes.c | 78 +---------------------
arch/ia64/kernel/kprobes.c | 79 +----------------------
arch/mips/kernel/kprobes.c | 55 +---------------
arch/parisc/kernel/kprobes.c | 78 ++--------------------
arch/powerpc/kernel/kprobes.c | 55 +---------------
arch/s390/kernel/kprobes.c | 81 +----------------------
arch/sh/kernel/kprobes.c | 59 +----------------
arch/sparc/kernel/kprobes.c | 52 +--------------
arch/x86/kernel/kprobes/core.c | 109 +------------------------------
include/linux/kprobes.h | 35 +++++++++-
kernel/kprobes.c | 126 +++++++++++++++++++++++++++++-------
14 files changed, 182 insertions(+), 838 deletions(-)
--
Masami Hiramatsu (Linaro) <mhiramat@kernel.org>
next reply other threads:[~2020-08-27 11:46 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-27 11:35 Masami Hiramatsu [this message]
2020-08-27 11:35 ` [PATCH v2 01/15] kprobes: Add generic kretprobe trampoline handler Masami Hiramatsu
2020-08-27 11:35 ` [PATCH v2 02/15] x86/kprobes: Use " Masami Hiramatsu
2020-08-27 11:35 ` [PATCH v2 03/15] arm: kprobes: " Masami Hiramatsu
2020-08-27 11:35 ` [PATCH v2 04/15] arm64: " Masami Hiramatsu
2020-08-27 11:36 ` [PATCH v2 05/15] arc: " Masami Hiramatsu
2020-08-27 11:36 ` [PATCH v2 06/15] csky: " Masami Hiramatsu
2020-08-27 11:36 ` [PATCH v2 07/15] ia64: " Masami Hiramatsu
2020-08-27 11:36 ` [PATCH v2 08/15] mips: " Masami Hiramatsu
2020-08-27 11:36 ` [PATCH v2 09/15] parisc: " Masami Hiramatsu
2020-08-27 11:36 ` [PATCH v2 10/15] powerpc: " Masami Hiramatsu
2020-08-27 11:37 ` [PATCH v2 11/15] s390: " Masami Hiramatsu
2020-08-27 11:37 ` [PATCH v2 12/15] sh: " Masami Hiramatsu
2020-08-27 11:37 ` [PATCH v2 13/15] sparc: " Masami Hiramatsu
2020-08-27 11:37 ` [PATCH v2 14/15] kprobes: Remove NMI context check Masami Hiramatsu
2020-08-27 11:37 ` [PATCH v2 15/15] kprobes: Free kretprobe_instance with rcu callback Masami Hiramatsu
2020-08-27 11:48 ` peterz
2020-08-27 11:50 ` Masami Hiramatsu
2020-08-27 11:49 ` peterz
2020-08-27 13:02 ` Masami Hiramatsu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=159852811819.707944.12798182250041968537.stgit@devnote2 \
--to=mhiramat@kernel.org \
--cc=Eddy_Wu@trendmicro.com \
--cc=anil.s.keshavamurthy@intel.com \
--cc=davem@davemloft.net \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=naveen.n.rao@linux.ibm.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).