Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1330785 > unrolled thread

Re: [PATCH v4 4/4] livepatch/module: remove livepatch module notifier

Started byRusty Russell <rusty@rustcorp.com.au>
First post2016-02-10 01:30 +0100
Last post2016-02-16 21:00 +0100
Articles 8 — 5 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH v4 4/4] livepatch/module: remove livepatch module notifier Rusty Russell <rusty@rustcorp.com.au> - 2016-02-10 01:30 +0100
    Re: [PATCH v4 4/4] livepatch/module: remove livepatch module  notifier Jiri Kosina <jikos@kernel.org> - 2016-02-10 11:30 +0100
      Re: [PATCH v4 4/4] livepatch/module: remove livepatch module  notifier Jiri Kosina <jikos@kernel.org> - 2016-02-15 00:40 +0100
        Re: [PATCH v4 4/4] livepatch/module: remove livepatch module notifier Josh Poimboeuf <jpoimboe@redhat.com> - 2016-02-16 00:30 +0100
          Re: [PATCH v4 4/4] livepatch/module: remove livepatch module  notifier Jiri Kosina <jikos@kernel.org> - 2016-02-16 00:50 +0100
            Re: livepatch/module: remove livepatch module notifier Jessica Yu <jeyu@redhat.com> - 2016-02-16 01:50 +0100
              Re: livepatch/module: remove livepatch module notifier Miroslav Benes <mbenes@suse.cz> - 2016-02-16 09:50 +0100
                Re: livepatch/module: remove livepatch module notifier Jessica Yu <jeyu@redhat.com> - 2016-02-16 21:00 +0100

#1330785 — Re: [PATCH v4 4/4] livepatch/module: remove livepatch module notifier

FromRusty Russell <rusty@rustcorp.com.au>
Date2016-02-10 01:30 +0100
SubjectRe: [PATCH v4 4/4] livepatch/module: remove livepatch module notifier
Message-ID<r0qPo-357-7@gated-at.bofh.it>
Jessica Yu <jeyu@redhat.com> writes:
> Remove the livepatch module notifier in favor of directly enabling and
> disabling patches to modules in the module loader. Hard-coding the
> function calls ensures that ftrace_module_enable() is run before
> klp_module_coming() during module load, and that klp_module_going() is
> run before ftrace_release_mod() during module unload. This way, ftrace
> and livepatch code is run in the correct order during the module
> load/unload sequence without dependence on the module notifier call chain.
>
> 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.

Without a Fixes: line, it's not absolutely clear whether this needs
CC:stable, needs to go to Linus now, or can wait for the next merge
window.

I *think* you want all four merged this merge window, and 3 and 4 are
required to fix a regression introduced since 4.4...

Sorry for being obtuse!
Rusty.

[toc] | [next] | [standalone]


#1331042 — Re: [PATCH v4 4/4] livepatch/module: remove livepatch module notifier

FromJiri Kosina <jikos@kernel.org>
Date2016-02-10 11:30 +0100
SubjectRe: [PATCH v4 4/4] livepatch/module: remove livepatch module notifier
Message-ID<r0Ac3-VA-41@gated-at.bofh.it>
In reply to#1330785
On Wed, 10 Feb 2016, Rusty Russell wrote:

> > Remove the livepatch module notifier in favor of directly enabling and
> > disabling patches to modules in the module loader. Hard-coding the
> > function calls ensures that ftrace_module_enable() is run before
> > klp_module_coming() during module load, and that klp_module_going() is
> > run before ftrace_release_mod() during module unload. This way, ftrace
> > and livepatch code is run in the correct order during the module
> > load/unload sequence without dependence on the module notifier call chain.
> >
> > 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.
> 
> Without a Fixes: line, it's not absolutely clear whether this needs
> CC:stable, needs to go to Linus now, or can wait for the next merge
> window.
> 
> I *think* you want all four merged this merge window, and 3 and 4 are
> required to fix a regression introduced since 4.4...

Your understanding is correct; #3 and #4 are needed to fix a 4.4 
regression. It makes sense for the whole lot go to together, but for #1 
and #2 I absolutely need your Ack before I take it to my tree, as I don't 
want to be merging this behind your back.

Once you Ack #1 and #2, I plan to take this to Linus immediately so that 
we avoid doing these changes as very last minute.

Thanks!

-- 
Jiri Kosina
SUSE Labs

[toc] | [prev] | [next] | [standalone]


#1333844 — Re: [PATCH v4 4/4] livepatch/module: remove livepatch module notifier

FromJiri Kosina <jikos@kernel.org>
Date2016-02-15 00:40 +0100
SubjectRe: [PATCH v4 4/4] livepatch/module: remove livepatch module notifier
Message-ID<r2eqM-1c5-67@gated-at.bofh.it>
In reply to#1331042
On Wed, 10 Feb 2016, Jiri Kosina wrote:

> > > Remove the livepatch module notifier in favor of directly enabling and
> > > disabling patches to modules in the module loader. Hard-coding the
> > > function calls ensures that ftrace_module_enable() is run before
> > > klp_module_coming() during module load, and that klp_module_going() is
> > > run before ftrace_release_mod() during module unload. This way, ftrace
> > > and livepatch code is run in the correct order during the module
> > > load/unload sequence without dependence on the module notifier call chain.
> > >
> > > 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.
> > 
> > Without a Fixes: line, it's not absolutely clear whether this needs
> > CC:stable, needs to go to Linus now, or can wait for the next merge
> > window.
> > 
> > I *think* you want all four merged this merge window, and 3 and 4 are
> > required to fix a regression introduced since 4.4...
> 
> Your understanding is correct; #3 and #4 are needed to fix a 4.4 
> regression. It makes sense for the whole lot go to together, but for #1 
> and #2 I absolutely need your Ack before I take it to my tree, as I don't 
> want to be merging this behind your back.
> 
> Once you Ack #1 and #2, I plan to take this to Linus immediately so that 
> we avoid doing these changes as very last minute.

Rusty, friendly ping? :)

I know that this is quite tight timing, but I'd like to have the 4.4 
regression fixed, and we are quite late in the -rc phase already.

Thanks in advance,

-- 
Jiri Kosina
SUSE Labs

[toc] | [prev] | [next] | [standalone]


#1334874

FromJosh Poimboeuf <jpoimboe@redhat.com>
Date2016-02-16 00:30 +0100
Message-ID<r2AKC-7Tu-3@gated-at.bofh.it>
In reply to#1333844
On Sun, Feb 14, 2016 at 11:59:00PM +0100, Jiri Kosina wrote:
> On Wed, 10 Feb 2016, Jiri Kosina wrote:
> 
> > > > Remove the livepatch module notifier in favor of directly enabling and
> > > > disabling patches to modules in the module loader. Hard-coding the
> > > > function calls ensures that ftrace_module_enable() is run before
> > > > klp_module_coming() during module load, and that klp_module_going() is
> > > > run before ftrace_release_mod() during module unload. This way, ftrace
> > > > and livepatch code is run in the correct order during the module
> > > > load/unload sequence without dependence on the module notifier call chain.
> > > >
> > > > 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.
> > > 
> > > Without a Fixes: line, it's not absolutely clear whether this needs
> > > CC:stable, needs to go to Linus now, or can wait for the next merge
> > > window.
> > > 
> > > I *think* you want all four merged this merge window, and 3 and 4 are
> > > required to fix a regression introduced since 4.4...
> > 
> > Your understanding is correct; #3 and #4 are needed to fix a 4.4 
> > regression. It makes sense for the whole lot go to together, but for #1 
> > and #2 I absolutely need your Ack before I take it to my tree, as I don't 
> > want to be merging this behind your back.
> > 
> > Once you Ack #1 and #2, I plan to take this to Linus immediately so that 
> > we avoid doing these changes as very last minute.
> 
> Rusty, friendly ping? :)
> 
> I know that this is quite tight timing, but I'd like to have the 4.4 
> regression fixed, and we are quite late in the -rc phase already.

So I think the commit causing the regression is 5156dca34a3e, which
occurred in the 4.5 cycle, *not* in 4.4.

Also it's my understanding that only the third patch ("remove ftrace
module notifier") is needed to fix the regression, and the other patches
are just general improvements.  So if needed I think we can just rebase
that patch (which already has Rusty's ack I believe) and send it to
Linus now.

-- 
Josh

[toc] | [prev] | [next] | [standalone]


#1334880 — Re: [PATCH v4 4/4] livepatch/module: remove livepatch module notifier

FromJiri Kosina <jikos@kernel.org>
Date2016-02-16 00:50 +0100
SubjectRe: [PATCH v4 4/4] livepatch/module: remove livepatch module notifier
Message-ID<r2B3Y-800-15@gated-at.bofh.it>
In reply to#1334874
On Mon, 15 Feb 2016, Josh Poimboeuf wrote:

> So I think the commit causing the regression is 5156dca34a3e, which
> occurred in the 4.5 cycle, *not* in 4.4.

Agreed, by "4.4 regresion" I mean "regression compared to 4.4"; i.e. 
regression that will become real issue once 4.5 is released.

> Also it's my understanding that only the third patch ("remove ftrace 
> module notifier") is needed to fix the regression, and the other patches 
> are just general improvements.  So if needed I think we can just rebase 
> that patch (which already has Rusty's ack I believe) and send it to 
> Linus now.

3/4 and 4/4 are be sufficient, yes (although I'd like to have this 
confimed by Jessica, as she apparently already has a reliable testcase).

To be honest: I was skiing (and being offline) thursday - sunday :), so my 
original plan was to get Ack from Rusty in the meantime, and then send 
pull request to Linus once I am back on sunday evening.

This is not going to happen, so we have to start with plan B (which is 
pushing just 3/4 and 4/4). Jessica, could you please send me updated (and 
tested on your side) patchset with module.c cleanups omitted?

Steven, I'd appreciate if you could tell me whether your Ack to 
"ftrace/module: remove ftrace module notifier" still holds even if 
module.c changes are not happening.

Thanks,

-- 
Jiri Kosina
SUSE Labs

[toc] | [prev] | [next] | [standalone]


#1334887 — Re: livepatch/module: remove livepatch module notifier

FromJessica Yu <jeyu@redhat.com>
Date2016-02-16 01:50 +0100
SubjectRe: livepatch/module: remove livepatch module notifier
Message-ID<r2C01-aC-3@gated-at.bofh.it>
In reply to#1334880
+++ Jiri Kosina [16/02/16 00:42 +0100]:
>On Mon, 15 Feb 2016, Josh Poimboeuf wrote:
>
>> So I think the commit causing the regression is 5156dca34a3e, which
>> occurred in the 4.5 cycle, *not* in 4.4.
>
>Agreed, by "4.4 regresion" I mean "regression compared to 4.4"; i.e.
>regression that will become real issue once 4.5 is released.
>
>> Also it's my understanding that only the third patch ("remove ftrace
>> module notifier") is needed to fix the regression, and the other patches
>> are just general improvements.  So if needed I think we can just rebase
>> that patch (which already has Rusty's ack I believe) and send it to
>> Linus now.
>
>3/4 and 4/4 are be sufficient, yes (although I'd like to have this
>confimed by Jessica, as she apparently already has a reliable testcase).

Yes, so Josh is right; technically only patch 3/4 "ftrace/module:
remove ftrace module notifier" is sufficient enough to fix the bug,
and patch 4/4 is just a natural extension of that change. Since I'm
going to be sending out another patchset anyway without the module.c
cleanups, I'll just keep them together.

Jessica

>To be honest: I was skiing (and being offline) thursday - sunday :), so my
>original plan was to get Ack from Rusty in the meantime, and then send
>pull request to Linus once I am back on sunday evening.
>
>This is not going to happen, so we have to start with plan B (which is
>pushing just 3/4 and 4/4). Jessica, could you please send me updated (and
>tested on your side) patchset with module.c cleanups omitted?
>
>Steven, I'd appreciate if you could tell me whether your Ack to
>"ftrace/module: remove ftrace module notifier" still holds even if
>module.c changes are not happening.
>
>Thanks,
>
>-- 
>Jiri Kosina
>SUSE Labs
>

[toc] | [prev] | [next] | [standalone]


#1335157 — Re: livepatch/module: remove livepatch module notifier

FromMiroslav Benes <mbenes@suse.cz>
Date2016-02-16 09:50 +0100
SubjectRe: livepatch/module: remove livepatch module notifier
Message-ID<r2Juy-5sH-15@gated-at.bofh.it>
In reply to#1334887
On Mon, 15 Feb 2016, Jessica Yu wrote:

> +++ Jiri Kosina [16/02/16 00:42 +0100]:
> > On Mon, 15 Feb 2016, Josh Poimboeuf wrote:
> > 
> > > So I think the commit causing the regression is 5156dca34a3e, which
> > > occurred in the 4.5 cycle, *not* in 4.4.
> > 
> > Agreed, by "4.4 regresion" I mean "regression compared to 4.4"; i.e.
> > regression that will become real issue once 4.5 is released.
> > 
> > > Also it's my understanding that only the third patch ("remove ftrace
> > > module notifier") is needed to fix the regression, and the other patches
> > > are just general improvements.  So if needed I think we can just rebase
> > > that patch (which already has Rusty's ack I believe) and send it to
> > > Linus now.
> > 
> > 3/4 and 4/4 are be sufficient, yes (although I'd like to have this
> > confimed by Jessica, as she apparently already has a reliable testcase).
> 
> Yes, so Josh is right; technically only patch 3/4 "ftrace/module:
> remove ftrace module notifier" is sufficient enough to fix the bug,
> and patch 4/4 is just a natural extension of that change. Since I'm
> going to be sending out another patchset anyway without the module.c
> cleanups, I'll just keep them together.

Yes, 3/4 should be sufficient to fix the bug. However if you take 4/4 too, 
you need 1/4 as well. Otherwise we would introduce a bug in error handling 
as Petr pointed out.

Cheers,
Miroslav

[toc] | [prev] | [next] | [standalone]


#1335762 — Re: livepatch/module: remove livepatch module notifier

FromJessica Yu <jeyu@redhat.com>
Date2016-02-16 21:00 +0100
SubjectRe: livepatch/module: remove livepatch module notifier
Message-ID<r2TWX-3TM-13@gated-at.bofh.it>
In reply to#1335157
+++ Miroslav Benes [16/02/16 09:41 +0100]:
>On Mon, 15 Feb 2016, Jessica Yu wrote:
>
>> +++ Jiri Kosina [16/02/16 00:42 +0100]:
>> > On Mon, 15 Feb 2016, Josh Poimboeuf wrote:
>> >
>> > > So I think the commit causing the regression is 5156dca34a3e, which
>> > > occurred in the 4.5 cycle, *not* in 4.4.
>> >
>> > Agreed, by "4.4 regresion" I mean "regression compared to 4.4"; i.e.
>> > regression that will become real issue once 4.5 is released.
>> >
>> > > Also it's my understanding that only the third patch ("remove ftrace
>> > > module notifier") is needed to fix the regression, and the other patches
>> > > are just general improvements.  So if needed I think we can just rebase
>> > > that patch (which already has Rusty's ack I believe) and send it to
>> > > Linus now.
>> >
>> > 3/4 and 4/4 are be sufficient, yes (although I'd like to have this
>> > confimed by Jessica, as she apparently already has a reliable testcase).
>>
>> Yes, so Josh is right; technically only patch 3/4 "ftrace/module:
>> remove ftrace module notifier" is sufficient enough to fix the bug,
>> and patch 4/4 is just a natural extension of that change. Since I'm
>> going to be sending out another patchset anyway without the module.c
>> cleanups, I'll just keep them together.
>
>Yes, 3/4 should be sufficient to fix the bug. However if you take 4/4 too,
>you need 1/4 as well. Otherwise we would introduce a bug in error handling
>as Petr pointed out.
>

Hm. I am just realizing that patch 4/4 will still need new ACK's for
the error handling portion. What I'll do is, after testing, send out
patch 3/4 ("ftrace/module: remove ftrace module notifier") as a
standalone patch to be merged immediately, since it fixes an actual
bug. The rest of this patchset will follow separately and can be
reviewed at its own pace.

Jessica

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web