* [GIT PULL] Modules updates for v5.13
@ 2021-04-28 12:58 Jessica Yu
2021-04-29 11:37 ` Jessica Yu
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Jessica Yu @ 2021-04-28 12:58 UTC (permalink / raw)
To: Linus Torvalds; +Cc: linux-kernel
Hi Linus,
Please pull below to receive modules updates for the v5.13 merge window.
A summary can be found in the signed tag.
Thank you,
Jessica
--
The following changes since commit 1e28eed17697bcf343c6743f0028cc3b5dd88bf0:
Linux 5.12-rc3 (2021-03-14 14:41:02 -0700)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/jeyu/linux.git tags/modules-for-v5.13
for you to fetch changes up to 33121347fb1c359bd6e3e680b9f2c6ced5734a81:
module: treat exit sections the same as init sections when !CONFIG_MODULE_UNLOAD (2021-03-29 13:08:53 +0200)
----------------------------------------------------------------
Modules updates for v5.13
Summary of modules changes for the 5.13 merge window:
- Fix an age old bug involving jump_calls and static_labels when
CONFIG_MODULE_UNLOAD=n. When CONFIG_MODULE_UNLOAD=n, it means you
can't unload modules, so normally the __exit sections of a module are
not loaded at all. However, dynamic code patching (jump_label,
static_call, alternatives) can have sites in __exit sections even if
__exit is never executed.
Reported by Peter Zijlstra: "Alternatives, jump_labels and static_call
all can have relocations into __exit code. Not loading it at all would
be BAD." Therefore, load the __exit sections even when
CONFIG_MODULE_UNLOAD=n, and discard them after init.
Signed-off-by: Jessica Yu <jeyu@kernel.org>
----------------------------------------------------------------
Jessica Yu (1):
module: treat exit sections the same as init sections when !CONFIG_MODULE_UNLOAD
kernel/module.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [GIT PULL] Modules updates for v5.13
2021-04-28 12:58 [GIT PULL] Modules updates for v5.13 Jessica Yu
@ 2021-04-29 11:37 ` Jessica Yu
2021-04-30 19:37 ` Linus Torvalds
2021-04-30 19:38 ` pr-tracker-bot
2 siblings, 0 replies; 5+ messages in thread
From: Jessica Yu @ 2021-04-29 11:37 UTC (permalink / raw)
To: Linus Torvalds; +Cc: linux-kernel
+++ Jessica Yu [28/04/21 14:58 +0200]:
>Hi Linus,
>
>Please pull below to receive modules updates for the v5.13 merge window.
>A summary can be found in the signed tag.
>
>Thank you,
>
>Jessica
Ugh, I had forgotten to sign the tag. Should be fixed now, sorry about that.
>--
>The following changes since commit 1e28eed17697bcf343c6743f0028cc3b5dd88bf0:
>
> Linux 5.12-rc3 (2021-03-14 14:41:02 -0700)
>
>are available in the Git repository at:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/jeyu/linux.git tags/modules-for-v5.13
>
>for you to fetch changes up to 33121347fb1c359bd6e3e680b9f2c6ced5734a81:
>
> module: treat exit sections the same as init sections when !CONFIG_MODULE_UNLOAD (2021-03-29 13:08:53 +0200)
>
>----------------------------------------------------------------
>Modules updates for v5.13
>
>Summary of modules changes for the 5.13 merge window:
>
>- Fix an age old bug involving jump_calls and static_labels when
> CONFIG_MODULE_UNLOAD=n. When CONFIG_MODULE_UNLOAD=n, it means you
> can't unload modules, so normally the __exit sections of a module are
> not loaded at all. However, dynamic code patching (jump_label,
> static_call, alternatives) can have sites in __exit sections even if
> __exit is never executed.
>
> Reported by Peter Zijlstra: "Alternatives, jump_labels and static_call
> all can have relocations into __exit code. Not loading it at all would
> be BAD." Therefore, load the __exit sections even when
> CONFIG_MODULE_UNLOAD=n, and discard them after init.
>
>Signed-off-by: Jessica Yu <jeyu@kernel.org>
>
>----------------------------------------------------------------
>Jessica Yu (1):
> module: treat exit sections the same as init sections when !CONFIG_MODULE_UNLOAD
>
> kernel/module.c | 9 ++++-----
> 1 file changed, 4 insertions(+), 5 deletions(-)
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [GIT PULL] Modules updates for v5.13
2021-04-28 12:58 [GIT PULL] Modules updates for v5.13 Jessica Yu
2021-04-29 11:37 ` Jessica Yu
@ 2021-04-30 19:37 ` Linus Torvalds
2021-05-03 10:13 ` Jessica Yu
2021-04-30 19:38 ` pr-tracker-bot
2 siblings, 1 reply; 5+ messages in thread
From: Linus Torvalds @ 2021-04-30 19:37 UTC (permalink / raw)
To: Jessica Yu, Peter Zijlstra (Intel); +Cc: Linux Kernel Mailing List
On Wed, Apr 28, 2021 at 5:58 AM Jessica Yu <jeyu@kernel.org> wrote:
>
> Therefore, load the __exit sections even when
> CONFIG_MODULE_UNLOAD=n, and discard them after init.
So I've pulled this, but I have two questions based on reading the patch..
(a) Where's that "discard them after init" logic?
(b) ARM has its own module_init/exit_section() functions, and now
seems to have different logic than everybody else as a result..
but maybe I'm not reading that patch right.
Linus
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [GIT PULL] Modules updates for v5.13
2021-04-28 12:58 [GIT PULL] Modules updates for v5.13 Jessica Yu
2021-04-29 11:37 ` Jessica Yu
2021-04-30 19:37 ` Linus Torvalds
@ 2021-04-30 19:38 ` pr-tracker-bot
2 siblings, 0 replies; 5+ messages in thread
From: pr-tracker-bot @ 2021-04-30 19:38 UTC (permalink / raw)
To: Jessica Yu; +Cc: Linus Torvalds, linux-kernel
The pull request you sent on Wed, 28 Apr 2021 14:58:44 +0200:
> git://git.kernel.org/pub/scm/linux/kernel/git/jeyu/linux.git tags/modules-for-v5.13
has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/65c61de9d090edb8a3cfb3f45541e268eb2cdb13
Thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/prtracker.html
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [GIT PULL] Modules updates for v5.13
2021-04-30 19:37 ` Linus Torvalds
@ 2021-05-03 10:13 ` Jessica Yu
0 siblings, 0 replies; 5+ messages in thread
From: Jessica Yu @ 2021-05-03 10:13 UTC (permalink / raw)
To: Linus Torvalds; +Cc: Peter Zijlstra (Intel), Linux Kernel Mailing List
+++ Linus Torvalds [30/04/21 12:37 -0700]:
>On Wed, Apr 28, 2021 at 5:58 AM Jessica Yu <jeyu@kernel.org> wrote:
>>
>> Therefore, load the __exit sections even when
>> CONFIG_MODULE_UNLOAD=n, and discard them after init.
Hi Linus,
>So I've pulled this, but I have two questions based on reading the patch..
>
> (a) Where's that "discard them after init" logic?
So the idea is for the exit sections to additionally identify as init
sections via module_init_section() when CONFIG_MODULE_UNLOAD=n, so
that the existing logic in layout_sections() picks this up and puts
the exit sections into the init area of the module (mod->init_layout.base).
Then, since we've placed the exit sections in the init region of the
module, they will automatically get freed at the end of
do_init_module() with the rest of the init sections. Peter has also
mentioned that jump_label and static_call want the exit sections to
also identify as init via within_module_init(), so this change should
satisfy their requirement as well. I should have explained this more
in the changelog and apologize that it wasn't clear.
> (b) ARM has its own module_init/exit_section() functions, and now
>seems to have different logic than everybody else as a result..
No, you are right, I had forgotten that ARM is a special case :-( I
will add a similar hunk for ARM and submit that for the next -rc so
that all arches are on the same page here.
Jessica
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-05-03 10:13 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-28 12:58 [GIT PULL] Modules updates for v5.13 Jessica Yu
2021-04-29 11:37 ` Jessica Yu
2021-04-30 19:37 ` Linus Torvalds
2021-05-03 10:13 ` Jessica Yu
2021-04-30 19:38 ` pr-tracker-bot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.