[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1424967232-2923-7-git-send-email-pmladek@suse.cz>
Date: Thu, 26 Feb 2015 17:13:51 +0100
From: Petr Mladek <pmladek@...e.cz>
To: Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>,
"David S. Miller" <davem@...emloft.net>,
Anil S Keshavamurthy <anil.s.keshavamurthy@...el.com>,
Ananth N Mavinakayanahalli <ananth@...ibm.com>,
Frederic Weisbecker <fweisbec@...il.com>
Cc: Ingo Molnar <mingo@...hat.com>,
Steven Rostedt <rostedt@...dmis.org>,
Jiri Kosina <jkosina@...e.cz>, linux-kernel@...r.kernel.org,
Petr Mladek <pmladek@...e.cz>
Subject: [PATCH 6/7] kprobes: Check kprobes_all_disarmed in kprobe_disarmed()
The global kprobes_all_disarmed flag says that all Kprobes are disarmed
even when they are marked as enabled. Therefore the flag should get
checked by kprobe_disarmed().
Signed-off-by: Petr Mladek <pmladek@...e.cz>
---
kernel/kprobes.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/kernel/kprobes.c b/kernel/kprobes.c
index 54bc2a6960b4..799f56a50cf9 100644
--- a/kernel/kprobes.c
+++ b/kernel/kprobes.c
@@ -391,6 +391,9 @@ static inline int kprobe_disarmed(struct kprobe *p)
{
struct optimized_kprobe *op;
+ if (kprobes_all_disarmed)
+ return 1;
+
/* If kprobe is not aggr/opt probe, just return kprobe is disabled */
if (!kprobe_aggrprobe(p))
return kprobe_disabled(p);
@@ -890,9 +893,17 @@ static void __disarm_kprobe(struct kprobe *p, bool reopt)
#define try_to_optimize_kprobe(p) do {} while (0)
#define __arm_kprobe(p) arch_arm_kprobe(p)
#define __disarm_kprobe(p, o) arch_disarm_kprobe(p)
-#define kprobe_disarmed(p) kprobe_disabled(p)
#define wait_for_kprobe_optimizer() do {} while (0)
+/* Return true(!0) if the kprobe is disarmed. Note: p must be on hash list */
+static inline int kprobe_disarmed(struct kprobe *p)
+{
+ if (kprobes_all_disarmed)
+ return 1;
+
+ return kprobe_disabled(p);
+}
+
/* There should be no unused kprobes can be reused without optimization */
static void reuse_unused_kprobe(struct kprobe *ap)
{
--
1.8.5.6
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists