From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752669AbcA2Goc (ORCPT ); Fri, 29 Jan 2016 01:44:32 -0500 Received: from mx1.redhat.com ([209.132.183.28]:40615 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752328AbcA2Goa (ORCPT ); Fri, 29 Jan 2016 01:44:30 -0500 From: Jessica Yu To: Josh Poimboeuf , Seth Jennings , Jiri Kosina , Vojtech Pavlik , Miroslav Benes , Steven Rostedt , Ingo Molnar Cc: live-patching@vger.kernel.org, linux-kernel@vger.kernel.org, Jessica Yu Subject: [PATCH 2/2] ftrace: Adjust priority of ftrace module notifier Date: Fri, 29 Jan 2016 01:43:47 -0500 Message-Id: <1454049827-3726-3-git-send-email-jeyu@redhat.com> In-Reply-To: <1454049827-3726-1-git-send-email-jeyu@redhat.com> References: <1454049827-3726-1-git-send-email-jeyu@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Adjust the priority of the ftrace module notifier such that it will run before the livepatch coming module notifier but after the livepatch going module modifier. This fixes a notifier ordering issue in which the ftrace module notifier (and hence ftrace_module_enable()) for COMING modules was being called after klp_module_notify(), which caused livepatch modules to initialize incorrectly. Signed-off-by: Jessica Yu --- kernel/trace/ftrace.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index eca592f..bdd7bfc 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c @@ -5067,7 +5067,12 @@ static int ftrace_module_notify(struct notifier_block *self, struct notifier_block ftrace_module_nb = { .notifier_call = ftrace_module_notify, - .priority = INT_MIN, /* Run after anything that can remove kprobes */ + /* + * Run after anything that can remove kprobes and + * after livepatch's going notifier, but run before + * livepatch's coming notifier. + */ + .priority = INT_MIN+1, }; void __init ftrace_init(void) -- 2.4.3