From: Jessica Yu <jeyu@kernel.org>
To: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: live-patching@vger.kernel.org, linux-kernel@vger.kernel.org,
Peter Zijlstra <peterz@infradead.org>,
Joe Lawrence <joe.lawrence@redhat.com>
Subject: Re: [PATCH v3 09/10] module: Remove module_disable_ro()
Date: Tue, 28 Apr 2020 20:56:40 +0200 [thread overview]
Message-ID: <20200428185639.GC12860@linux-8ccs.fritz.box> (raw)
In-Reply-To: <20200428170309.xrsmqdwj5qu2q6t6@treble>
+++ Josh Poimboeuf [28/04/20 12:03 -0500]:
>On Tue, Apr 28, 2020 at 06:41:55PM +0200, Jessica Yu wrote:
>> +++ Josh Poimboeuf [28/04/20 11:36 -0500]:
>> > On Tue, Apr 28, 2020 at 06:25:05PM +0200, Jessica Yu wrote:
>> > > +++ Josh Poimboeuf [25/04/20 06:07 -0500]:
>> > > > module_disable_ro() has no more users. Remove it.
>> > > >
>> > > > Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
>> > > > Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
>> > >
>> > > Hm, I guess this means we can also remove the module_enable_ro() stubs
>> > > in module.h and make it a static function again (like the other
>> > > module_enable_* functions) as there are no more outside users. I have to
>> > > remind myself after this patchset is merged :-)
>> >
>> > Ah, true. I'm respinning the patch set anyway, I can just add this as a
>> > another patch.
>>
>> That would be great. Thanks!
>
>Sneak preview:
>
>From: Josh Poimboeuf <jpoimboe@redhat.com>
>Subject: [PATCH] module: Make module_enable_ro() static again
>
>Now that module_enable_ro() has no more external users, make it static
>again.
>
>Suggested-by: Jessica Yu <jeyu@kernel.org>
>Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
>---
> include/linux/module.h | 6 ------
> kernel/module.c | 4 ++--
> 2 files changed, 2 insertions(+), 8 deletions(-)
>
>diff --git a/include/linux/module.h b/include/linux/module.h
>index e4ef7b36feda..2c2e988bcf10 100644
>--- a/include/linux/module.h
>+++ b/include/linux/module.h
>@@ -858,12 +858,6 @@ extern int module_sysfs_initialized;
>
> #define __MODULE_STRING(x) __stringify(x)
>
>-#ifdef CONFIG_STRICT_MODULE_RWX
>-extern void module_enable_ro(const struct module *mod, bool after_init);
>-#else
>-static inline void module_enable_ro(const struct module *mod, bool after_init) { }
>-#endif
>-
> #ifdef CONFIG_GENERIC_BUG
> void module_bug_finalize(const Elf_Ehdr *, const Elf_Shdr *,
> struct module *);
>diff --git a/kernel/module.c b/kernel/module.c
>index f0e414a01d91..6d8aab60943e 100644
>--- a/kernel/module.c
>+++ b/kernel/module.c
>@@ -2016,7 +2016,7 @@ static void frob_writable_data(const struct module_layout *layout,
> (layout->size - layout->ro_after_init_size) >> PAGE_SHIFT);
> }
>
>-void module_enable_ro(const struct module *mod, bool after_init)
>+static void module_enable_ro(const struct module *mod, bool after_init)
> {
> if (!rodata_enabled)
> return;
>@@ -2057,7 +2057,7 @@ static int module_enforce_rwx_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs,
> }
>
> #else /* !CONFIG_STRICT_MODULE_RWX */
>-/* module_{enable,disable}_ro() stubs are in module.h */
>+void module_enable_ro(const struct module *mod, bool after_init) {}
Missing static here, but otherwise looks good. Thanks!
> static void module_enable_nx(const struct module *mod) { }
> static int module_enforce_rwx_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs,
> char *secstrings, struct module *mod)
>--
>2.21.1
>
next prev parent reply other threads:[~2020-04-28 18:56 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-25 11:07 [PATCH v3 00/10] livepatch,module: Remove .klp.arch and module_disable_ro() Josh Poimboeuf
2020-04-25 11:07 ` [PATCH v3 01/10] livepatch: Disallow vmlinux.ko Josh Poimboeuf
2020-04-25 11:07 ` [PATCH v3 02/10] livepatch: Apply vmlinux-specific KLP relocations early Josh Poimboeuf
2020-04-28 9:20 ` Miroslav Benes
2020-04-25 11:07 ` [PATCH v3 03/10] livepatch: Remove .klp.arch Josh Poimboeuf
2020-04-25 11:07 ` [PATCH v3 04/10] livepatch: Prevent module-specific KLP rela sections from referencing vmlinux symbols Josh Poimboeuf
2020-04-25 11:07 ` [PATCH v3 05/10] s390: Change s390_kernel_write() return type to match memcpy() Josh Poimboeuf
2020-04-25 11:07 ` [PATCH v3 06/10] s390/module: Use s390_kernel_write() for late relocations Josh Poimboeuf
2020-04-25 11:14 ` Josh Poimboeuf
2020-04-25 11:07 ` [PATCH v3 07/10] x86/module: Use text_poke() " Josh Poimboeuf
2020-04-25 11:07 ` [PATCH v3 08/10] livepatch: Remove module_disable_ro() usage Josh Poimboeuf
2020-04-25 11:07 ` [PATCH v3 09/10] module: Remove module_disable_ro() Josh Poimboeuf
2020-04-28 16:25 ` Jessica Yu
2020-04-28 16:36 ` Josh Poimboeuf
2020-04-28 16:41 ` Jessica Yu
2020-04-28 17:03 ` Josh Poimboeuf
2020-04-28 18:56 ` Jessica Yu [this message]
2020-04-25 11:07 ` [PATCH v3 10/10] x86/module: Use text_mutex in apply_relocate_add() Josh Poimboeuf
2020-04-27 12:22 ` [PATCH v3 00/10] livepatch,module: Remove .klp.arch and module_disable_ro() Joe Lawrence
2020-04-27 12:32 ` Miroslav Benes
2020-04-27 16:52 ` Joe Lawrence
2020-04-28 13:48 ` Miroslav Benes
2020-04-28 14:35 ` Josh Poimboeuf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200428185639.GC12860@linux-8ccs.fritz.box \
--to=jeyu@kernel.org \
--cc=joe.lawrence@redhat.com \
--cc=jpoimboe@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=live-patching@vger.kernel.org \
--cc=peterz@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).