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


Groups > linux.kernel > #1510150 > unrolled thread

Re: [RFC PATCH v2 2/2] module: When modifying a module's text ignore modules which are going away too

Started bySteven Rostedt <rostedt@goodmis.org>
First post2016-10-27 16:00 +0200
Last post2016-11-09 11:50 +0100
Articles 3 — 3 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: [RFC PATCH v2 2/2] module: When modifying a module's text  ignore modules which are going away too Steven Rostedt <rostedt@goodmis.org> - 2016-10-27 16:00 +0200
    Re: [RFC PATCH v2 2/2] module: When modifying a module's text ignore  modules which are going away too Aaron Tomlin <atomlin@redhat.com> - 2016-11-07 12:50 +0100
      Re: module: When modifying a module's text ignore modules which are  going away too Jessica Yu <jeyu@redhat.com> - 2016-11-09 11:50 +0100

#1510150 — Re: [RFC PATCH v2 2/2] module: When modifying a module's text ignore modules which are going away too

FromSteven Rostedt <rostedt@goodmis.org>
Date2016-10-27 16:00 +0200
SubjectRe: [RFC PATCH v2 2/2] module: When modifying a module's text ignore modules which are going away too
Message-ID<swTnP-2Bn-23@gated-at.bofh.it>
This looks line to me. Rusty, do you have any issues with this?

Maybe we should add a comment to why a going module shouldn't be
converted to ro (because of ftrace and kprobes). But other than that,
I have no issue with it.

I also added Jessica to the Cc as I notice she will be the new module
maintainer: http://lwn.net/Articles/704653/

-- Steve


On Thu, 27 Oct 2016 10:36:06 +0100
Aaron Tomlin <atomlin@redhat.com> wrote:

> By default, during the access permission modification of a module's core
> and init pages, we only ignore modules that are malformed. Albeit for a
> module which is going away, it does not make sense to change its text to
> RO since the module should be RW, before deallocation.
> 
> This patch makes set_all_modules_text_ro() skip modules which are going
> away too.
> 
> Signed-off-by: Aaron Tomlin <atomlin@redhat.com>
> ---
>  kernel/module.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/kernel/module.c b/kernel/module.c
> index ff93ab8..2a383df 100644
> --- a/kernel/module.c
> +++ b/kernel/module.c
> @@ -1969,7 +1969,8 @@ void set_all_modules_text_ro(void)
>  
>  	mutex_lock(&module_mutex);
>  	list_for_each_entry_rcu(mod, &modules, list) {
> -		if (mod->state == MODULE_STATE_UNFORMED)
> +		if (mod->state == MODULE_STATE_UNFORMED ||
> +			mod->state == MODULE_STATE_GOING)
>  			continue;
>  
>  		frob_text(&mod->core_layout, set_memory_ro);

[toc] | [next] | [standalone]


#1516027 — Re: [RFC PATCH v2 2/2] module: When modifying a module's text ignore modules which are going away too

FromAaron Tomlin <atomlin@redhat.com>
Date2016-11-07 12:50 +0100
SubjectRe: [RFC PATCH v2 2/2] module: When modifying a module's text ignore modules which are going away too
Message-ID<sAQB4-2vw-15@gated-at.bofh.it>
In reply to#1510150
On Thu 2016-10-27 09:49 -0400, Steven Rostedt wrote:
[ ... ]
> I also added Jessica to the Cc as I notice she will be the new module
> maintainer: http://lwn.net/Articles/704653/

Hi Jessica,

Any thoughts?

Thanks,

-- 
Aaron Tomlin

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


#1517900 — Re: module: When modifying a module's text ignore modules which are going away too

FromJessica Yu <jeyu@redhat.com>
Date2016-11-09 11:50 +0100
SubjectRe: module: When modifying a module's text ignore modules which are going away too
Message-ID<sByC5-69v-33@gated-at.bofh.it>
In reply to#1516027
+++ Aaron Tomlin [07/11/16 11:46 +0000]:
>Hi Jessica,
>
>Any thoughts?

Hi Aaron,

Thanks for your patience as I slowly work through a large swath of emails :-)

Anyway, this looks fine to me. A going module's text should be (or
soon will be) rw anyway, so checking for going modules in the ro
case should be enough.

Rusty, if you give your ack for the second patch, I can apply both
patches to my modules-next branch. I'll also incorporate Steven's
suggestion for a comment explaining why going modules shouldn't be
converted to ro in this context.

Thanks,
Jessica

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web