linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Fix ordering of ftrace + livepatch module notifier callbacks
@ 2016-01-29  6:43 Jessica Yu
  2016-01-29  6:43 ` [PATCH 1/2] livepatch: Implement separate coming and going module notifiers Jessica Yu
  2016-01-29  6:43 ` [PATCH 2/2] ftrace: Adjust priority of ftrace module notifier Jessica Yu
  0 siblings, 2 replies; 27+ messages in thread
From: Jessica Yu @ 2016-01-29  6:43 UTC (permalink / raw)
  To: Josh Poimboeuf, Seth Jennings, Jiri Kosina, Vojtech Pavlik,
	Miroslav Benes, Steven Rostedt, Ingo Molnar
  Cc: live-patching, linux-kernel, Jessica Yu

As explained here [1], livepatch modules are failing to initialize properly
because the ftrace coming module notifier (which calls
ftrace_module_enable()) runs after the livepatch module notifier (which
enables the patch(es)). Thus livepatch attempts to apply patches to modules
before ftrace_module_enable() is even called for the corresponding
module(s). Separate klp_module_notify() into coming and going notifiers
and tweak the priorities to fix the order in which the ftrace and livepatch
notifiers are called.

Tested the changes with a test livepatch module that patches 9p and nilfs2,
and verified that the issue is fixed.

Patch 1/2 based on the 'for-next' branch in livepatching -
git://git.kernel.org/pub/scm/linux/kernel/git/jikos/livepatching.git

Patch 2/2 based on the 'ftrace/core' branch in linux-trace -
git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git

[1] http://lkml.kernel.org/g/20160128204033.GA32131@packer-debian-8-amd64.digitalocean.com

Jessica Yu (2):
  livepatch: Implement separate coming and going module notifiers
  ftrace: Adjust priority of ftrace module notifier

 kernel/livepatch/core.c | 128 +++++++++++++++++++++++++++---------------------
 kernel/trace/ftrace.c   |   7 ++-
 2 files changed, 79 insertions(+), 56 deletions(-)

-- 
2.4.3

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

end of thread, other threads:[~2016-02-01 14:48 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-29  6:43 [PATCH 0/2] Fix ordering of ftrace + livepatch module notifier callbacks Jessica Yu
2016-01-29  6:43 ` [PATCH 1/2] livepatch: Implement separate coming and going module notifiers Jessica Yu
2016-01-29 16:30   ` Miroslav Benes
2016-01-29 17:30     ` Josh Poimboeuf
2016-01-29 17:40       ` Steven Rostedt
2016-01-29 17:58         ` Josh Poimboeuf
2016-01-29 19:25           ` Miroslav Benes
2016-01-29 19:29             ` Steven Rostedt
2016-01-29 19:47               ` Josh Poimboeuf
2016-01-29 20:08                 ` Steven Rostedt
2016-01-29 20:15                   ` Josh Poimboeuf
2016-02-01 12:27                     ` Jiri Kosina
2016-02-01 14:48                       ` Josh Poimboeuf
2016-01-29 19:51               ` Jessica Yu
2016-01-29 19:42             ` [PATCH 1/2] " Josh Poimboeuf
2016-01-29 22:58               ` Jessica Yu
2016-01-30  0:02                 ` Steven Rostedt
2016-02-01 14:37                 ` Josh Poimboeuf
2016-01-29 20:04       ` Jessica Yu
2016-01-29 20:09         ` Steven Rostedt
2016-01-29 20:10           ` Steven Rostedt
2016-01-29 20:20         ` Josh Poimboeuf
2016-01-29  6:43 ` [PATCH 2/2] ftrace: Adjust priority of ftrace module notifier Jessica Yu
2016-01-29 14:38   ` Steven Rostedt
2016-01-29 15:45     ` Josh Poimboeuf
2016-01-29 15:49       ` Steven Rostedt
2016-01-29 15:50         ` Josh Poimboeuf

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).