linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Josh Poimboeuf <jpoimboe@redhat.com>
To: Jessica Yu <jeyu@redhat.com>
Cc: Miroslav Benes <mbenes@suse.cz>,
	Seth Jennings <sjenning@redhat.com>,
	Jiri Kosina <jikos@kernel.org>, Vojtech Pavlik <vojtech@suse.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Ingo Molnar <mingo@redhat.com>,
	live-patching@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: livepatch: Implement separate coming and going module notifiers
Date: Fri, 29 Jan 2016 14:20:23 -0600	[thread overview]
Message-ID: <20160129202023.GF19101@treble.redhat.com> (raw)
In-Reply-To: <20160129200451.GB14026@packer-debian-8-amd64.digitalocean.com>

On Fri, Jan 29, 2016 at 03:04:51PM -0500, Jessica Yu wrote:
> +++ Josh Poimboeuf [29/01/16 11:30 -0600]:
> >On Fri, Jan 29, 2016 at 05:30:46PM +0100, Miroslav Benes wrote:
> >>Otherwise than that it looks good. I agree there are advantages to split
> >>the notifiers. For example we can replace the coming one with the function
> >>call somewhere in load_module() to improve error handling if the patching
> >>fails while loading a module. This would be handy with a consistency model
> >>in the future.
> >
> >Yeah, we'll need something like that eventually.  Though we'll need to
> >make sure that ftrace_module_enable() is still called beforehand, after
> >setting MODULE_STATE_COMING state, due to the race described in 5156dca.
> >
> >Something like:
> >
> >[note: klp_module_notify_coming() is replaced with klp_module_enable()]
> >
> >diff --git a/kernel/module.c b/kernel/module.c
> >index 8358f46..aeabd81 100644
> >--- a/kernel/module.c
> >+++ b/kernel/module.c
> >@@ -3371,6 +3371,13 @@ static int complete_formation(struct module *mod, struct load_info *info)
> >	mod->state = MODULE_STATE_COMING;
> >	mutex_unlock(&module_mutex);
> >
> >+	ftrace_module_enable(mod);
> >+	err = klp_module_enable(mod);
> >+	if (err) {
> >+		ftrace_release_mod(mod);
> >+		return err;
> >+	}
> 
> If we go this route, should we should print a big warning ("Livepatch
> couldn't patch loading module X") instead of aborting the module load
> completely?

I think aborting the module load is better.  Otherwise the patch would
be applied in an inconsistent state.  Which might not be all that bad
now, since we don't have a consistency model anyway; but it could be
disastrous once we get one, if somebody is relying on that consistency.

-- 
Josh

  parent reply	other threads:[~2016-01-29 20:20 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160129202023.GF19101@treble.redhat.com \
    --to=jpoimboe@redhat.com \
    --cc=jeyu@redhat.com \
    --cc=jikos@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=live-patching@vger.kernel.org \
    --cc=mbenes@suse.cz \
    --cc=mingo@redhat.com \
    --cc=rostedt@goodmis.org \
    --cc=sjenning@redhat.com \
    --cc=vojtech@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).