Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1326894
| From | Steven Rostedt <rostedt@goodmis.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v2 2/2] livepatch/module: remove livepatch module notifier |
| Date | 2016-02-04 16:00 +0100 |
| Message-ID | <qYty2-3iA-17@gated-at.bofh.it> (permalink) |
| References | <qXxNo-38h-5@gated-at.bofh.it> <qXxNo-38h-13@gated-at.bofh.it> <qYteI-3bN-47@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Thu, 4 Feb 2016 15:39:35 +0100 Petr Mladek <pmladek@suse.com> wrote: > > @@ -3375,6 +3378,10 @@ static int complete_formation(struct module *mod, struct load_info *info) > > mutex_unlock(&module_mutex); > > > > ftrace_module_enable(mod); > > + err = klp_module_enable(mod); > > + if (err) > > + goto out; > > If you go out here, you need to revert some some operations > that are normally done in the bug_cleanup: goto target > in load_module(). In particular, you need to do: > > /* module_bug_cleanup needs module_mutex protection */ > mutex_lock(&module_mutex); > module_bug_cleanup(mod); > mutex_unlock(&module_mutex); > > ftrace_release_mod(mod); > > /* we can't deallocate the module until we clear memory protection */ > module_disable_ro(mod); > module_disable_nx(mod); > > > IMHO, it would make sense to somehow split the complete_formation() function > and avoid a code duplication in the error paths. If complete_formation() fails, load_module will do a goto ddebug_cleanup, which will eventually call ftrace_release_mod(). No need to do it here. -- Steve
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v2 2/2] livepatch/module: remove livepatch module notifier Jessica Yu <jeyu@redhat.com> - 2016-02-02 02:20 +0100
Re: [PATCH v2 2/2] livepatch/module: remove livepatch module notifier Petr Mladek <pmladek@suse.com> - 2016-02-04 15:40 +0100
Re: [PATCH v2 2/2] livepatch/module: remove livepatch module notifier Steven Rostedt <rostedt@goodmis.org> - 2016-02-04 16:00 +0100
Re: [PATCH v2 2/2] livepatch/module: remove livepatch module notifier Miroslav Benes <mbenes@suse.cz> - 2016-02-04 17:50 +0100
Re: livepatch/module: remove livepatch module notifier Jessica Yu <jeyu@redhat.com> - 2016-02-05 05:20 +0100
Re: livepatch/module: remove livepatch module notifier Miroslav Benes <mbenes@suse.cz> - 2016-02-05 10:20 +0100
Re: livepatch/module: remove livepatch module notifier Petr Mladek <pmladek@suse.com> - 2016-02-05 11:10 +0100
Re: livepatch/module: remove livepatch module notifier Rusty Russell <rusty@rustcorp.com.au> - 2016-02-08 03:00 +0100
Re: [PATCH v2 2/2] livepatch/module: remove livepatch module notifier Miroslav Benes <mbenes@suse.cz> - 2016-02-04 18:40 +0100
Re: [PATCH v2 2/2] livepatch/module: remove livepatch module notifier Josh Poimboeuf <jpoimboe@redhat.com> - 2016-02-04 22:00 +0100
Re: [PATCH v2 2/2] livepatch/module: remove livepatch module notifier Miroslav Benes <mbenes@suse.cz> - 2016-02-05 10:00 +0100
csiph-web