Merge tag 'modules-7.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/modules/linux

Pull modules updates from Sami Tolvanen:

 - Add a missing return value check for module_extend_max_pages() to
   prevent a kernel oops on memory allocation failure.

 - Force sh_addr to 0 for architecture-specific module sections on arm,
   arm64, m68k, and riscv. This prevents non-zero section addresses when
   linking modules with ld.bfd -r, which may cause tools to misbehave
   and result in worse compressibility.

 - Replace pr_warn! with pr_warn_once! for set_param null pointer
   warnings in Rust abstractions, now that the _once variant is
   available.

* tag 'modules-7.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/modules/linux:
  rust: module_param: add missing newline to pr_warn_once
  module: decompress: check return value of module_extend_max_pages()
  rust: module_param: use `pr_warn_once!` for null pointer warning
  module, riscv: force sh_addr=0 for arch-specific sections
  module, m68k: force sh_addr=0 for arch-specific sections
  module, arm64: force sh_addr=0 for arch-specific sections
  module, arm: force sh_addr=0 for arch-specific sections
This commit is contained in:
Linus Torvalds
2026-06-17 11:35:58 +01:00
6 changed files with 11 additions and 10 deletions

View File

@@ -1,7 +1,7 @@
/* SPDX-License-Identifier: GPL-2.0 */
#ifdef CONFIG_ARM_MODULE_PLTS
SECTIONS {
.plt : { BYTE(0) }
.init.plt : { BYTE(0) }
.plt 0 : { BYTE(0) }
.init.plt 0 : { BYTE(0) }
}
#endif

View File

@@ -14,7 +14,7 @@ SECTIONS {
* directive to force them into a single section and silence the
* warning.
*/
.text.hot : { *(.text.hot) }
.text.hot 0 : { *(.text.hot) }
#endif
#ifdef CONFIG_UNWIND_TABLES
@@ -22,6 +22,6 @@ SECTIONS {
* Currently, we only use unwind info at module load time, so we can
* put it into the .init allocation.
*/
.init.eh_frame : { *(.eh_frame) }
.init.eh_frame 0 : { *(.eh_frame) }
#endif
}

View File

@@ -1,5 +1,5 @@
SECTIONS {
.m68k_fixup : {
.m68k_fixup 0 : {
__start_fixup = .;
*(.m68k_fixup)
__stop_fixup = .;

View File

@@ -2,8 +2,8 @@
/* Copyright (C) 2017 Andes Technology Corporation */
#ifdef CONFIG_MODULE_SECTIONS
SECTIONS {
.plt : { BYTE(0) }
.got : { BYTE(0) }
.got.plt : { BYTE(0) }
.plt 0 : { BYTE(0) }
.got 0 : { BYTE(0) }
.got.plt 0 : { BYTE(0) }
}
#endif

View File

@@ -307,6 +307,8 @@ int module_decompress(struct load_info *info, const void *buf, size_t size)
*/
n_pages = DIV_ROUND_UP(size, PAGE_SIZE) * 2;
error = module_extend_max_pages(info, n_pages);
if (error)
return error;
data_size = MODULE_DECOMPRESS_FN(info, buf, size);
if (data_size < 0) {

View File

@@ -62,8 +62,7 @@ pub trait ModuleParam: Sized + Copy {
// NOTE: If we start supporting arguments without values, val _is_ allowed
// to be null here.
if val.is_null() {
// TODO: Use pr_warn_once available.
crate::pr_warn!("Null pointer passed to `module_param::set_param`");
crate::pr_warn_once!("Null pointer passed to `module_param::set_param`\n");
return EINVAL.to_errno();
}