Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935017AbcJ0Ntm (ORCPT ); Thu, 27 Oct 2016 09:49:42 -0400 Received: from smtprelay0101.hostedemail.com ([216.40.44.101]:37831 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S934786AbcJ0Ntk (ORCPT ); Thu, 27 Oct 2016 09:49:40 -0400 X-Session-Marker: 726F737465647440676F6F646D69732E6F7267 X-Spam-Summary: 50,0,0,,d41d8cd98f00b204,rostedt@goodmis.org,:::::::,RULES_HIT:41:355:379:541:599:800:960:967:973:988:989:1260:1263:1277:1311:1313:1314:1345:1359:1431:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2525:2553:2560:2563:2682:2685:2693:2859:2898:2901:2933:2937:2939:2942:2945:2947:2951:2954:3022:3138:3139:3140:3141:3142:3353:3865:3866:3867:3868:3871:3872:3873:3874:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:5007:6119:6120:6261:7875:7903:9010:9025:9388:10004:10400:10471:10848:10967:11026:11232:11473:11658:11914:12043:12438:12555:12679:12740:12760:13069:13255:13311:13357:13437:13439:14096:14097:14181:14659:14721:21067:21080:21433:30045:30054:30070:30090:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:2,LUA_SUMMARY:none X-HE-Tag: sink29_19a8f8f159027 X-Filterd-Recvd-Size: 2412 Date: Thu, 27 Oct 2016 09:49:34 -0400 From: Steven Rostedt To: Aaron Tomlin Cc: linux-kernel@vger.kernel.org, rusty@rustcorp.com.au, Jessica Yu Subject: Re: [RFC PATCH v2 2/2] module: When modifying a module's text ignore modules which are going away too Message-ID: <20161027094934.296d668d@gandalf.local.home> In-Reply-To: <1477560966-781-1-git-send-email-atomlin@redhat.com> References: <20161026080914.5bc68d0d@gandalf.local.home> <1477560966-781-1-git-send-email-atomlin@redhat.com> X-Mailer: Claws Mail 3.14.0 (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1418 Lines: 43 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 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 > --- > 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);