Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751965AbcKRGSR (ORCPT ); Fri, 18 Nov 2016 01:18:17 -0500 Received: from ozlabs.org ([103.22.144.67]:54259 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751095AbcKRGSQ (ORCPT ); Fri, 18 Nov 2016 01:18:16 -0500 From: Rusty Russell To: Aaron Tomlin , linux-kernel@vger.kernel.org Cc: rostedt@goodmis.org, "Jessica Yu" Subject: Re: [RFC PATCH v2 2/2] module: When modifying a module's text ignore modules which are going away too 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> User-Agent: Notmuch/0.22.1 (http://notmuchmail.org) Emacs/24.5.1 (x86_64-pc-linux-gnu) Date: Fri, 18 Nov 2016 16:45:29 +1030 Message-ID: <874m359uv2.fsf@rustcorp.com.au> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1107 Lines: 36 Aaron Tomlin writes: > 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 Acked-by: Rusty Russell Thanks! Rusty. > --- > 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); > -- > 2.5.5