public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/7] kprobe: Handle error when Kprobe ftrace arming fails
@ 2015-02-26 16:13 Petr Mladek
  2015-02-26 16:13 ` [PATCH 1/7] kprobes: Disable Kprobe when " Petr Mladek
                   ` (7 more replies)
  0 siblings, 8 replies; 14+ messages in thread
From: Petr Mladek @ 2015-02-26 16:13 UTC (permalink / raw)
  To: Masami Hiramatsu, David S. Miller, Anil S Keshavamurthy,
	Ananth N Mavinakayanahalli, Frederic Weisbecker
  Cc: Ingo Molnar, Steven Rostedt, Jiri Kosina, linux-kernel,
	Petr Mladek

arm_kprobe_ftrace() could fail, especially after introducing ftrace IPMODIFY
flag and LifePatching. This patch set adds the error handling and also some
related fixes.

1st patch includes the most important change. It helps to keep Kprobes
in a sane state.

2nd and 3rd patch allows to propagate the error where needed.

The other patches fix problems with the global kprobes_all_disarmed flag.
They were there even before but they become more visible and critical
after the arming errors became propagated.


The first patch looks rather safe and might be suitable even for 4.0.

However, I would feel more comfortable if the other patches get some
testing in linux-next. I did quite some testing and did my best. But
I started with the three patches and was surprised by the effect of
the propagated errors. They triggered that BUG_ON() in
__unregister_kprobe_top() are required the other patches
to get it working. I wonder if there is any other scenario that
I have missed.

Of course, I also wait for feedback how to make things better.


Petr Mladek (7):
  kprobes: Disable Kprobe when ftrace arming fails
  kprobes: Propagate error from arm_kprobe_ftrace()
  kprobes: Propagate error from disarm_kprobe_ftrace()
  kprobes: Keep consistent state of kprobes_all_disarmed
  kprobes: Do not try to disarm already disarmed Kprobe
  kprobes: Check kprobes_all_disarmed in kprobe_disarmed()
  kprobes: Mark globally disabled Kprobes in debugfs interface

 Documentation/kprobes.txt |   5 +-
 kernel/kprobes.c          | 279 ++++++++++++++++++++++++++++++++++------------
 2 files changed, 213 insertions(+), 71 deletions(-)

-- 
1.8.5.6


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

end of thread, other threads:[~2015-03-13 12:36 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-26 16:13 [PATCH 0/7] kprobe: Handle error when Kprobe ftrace arming fails Petr Mladek
2015-02-26 16:13 ` [PATCH 1/7] kprobes: Disable Kprobe when " Petr Mladek
2015-02-27  6:26   ` Masami Hiramatsu
2015-02-26 16:13 ` [PATCH 2/7] kprobes: Propagate error from arm_kprobe_ftrace() Petr Mladek
2015-02-27  7:35   ` Masami Hiramatsu
2015-02-26 16:13 ` [PATCH 3/7] kprobes: Propagate error from disarm_kprobe_ftrace() Petr Mladek
2015-02-27  8:01   ` Masami Hiramatsu
2015-02-26 16:13 ` [PATCH 4/7] kprobes: Keep consistent state of kprobes_all_disarmed Petr Mladek
2015-02-26 16:13 ` [PATCH 5/7] kprobes: Do not try to disarm already disarmed Kprobe Petr Mladek
2015-02-26 16:13 ` [PATCH 6/7] kprobes: Check kprobes_all_disarmed in kprobe_disarmed() Petr Mladek
2015-02-26 16:13 ` [PATCH 7/7] kprobes: Mark globally disabled Kprobes in debugfs interface Petr Mladek
2015-02-27  7:32 ` [PATCH 0/7] kprobe: Handle error when Kprobe ftrace arming fails Masami Hiramatsu
2015-03-12 16:33   ` Petr Mladek
2015-03-13 12:36     ` Masami Hiramatsu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox