Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754596AbbBZQN0 (ORCPT ); Thu, 26 Feb 2015 11:13:26 -0500 Received: from cantor2.suse.de ([195.135.220.15]:58776 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754570AbbBZQNY (ORCPT ); Thu, 26 Feb 2015 11:13:24 -0500 From: Petr Mladek To: Masami Hiramatsu , "David S. Miller" , Anil S Keshavamurthy , Ananth N Mavinakayanahalli , Frederic Weisbecker Cc: Ingo Molnar , Steven Rostedt , Jiri Kosina , linux-kernel@vger.kernel.org, Petr Mladek Subject: [PATCH 6/7] kprobes: Check kprobes_all_disarmed in kprobe_disarmed() Date: Thu, 26 Feb 2015 17:13:51 +0100 Message-Id: <1424967232-2923-7-git-send-email-pmladek@suse.cz> X-Mailer: git-send-email 1.8.5.6 In-Reply-To: <1424967232-2923-1-git-send-email-pmladek@suse.cz> References: <1424967232-2923-1-git-send-email-pmladek@suse.cz> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1662 Lines: 50 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 --- 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/