Skip to contentSkip to conversation

Modules changes for v7.1-rc1

GIT PULL Merged Sami Tolvanen 2 participants 2 messages Apr 13 – Apr 15

lore
Share & tools
lore
#0 lore raw

The following changes since commit f338e77383789c0cae23ca3d48adcc5e9e137e3c:

Linux 7.0-rc4 (2026-03-15 13:52:05 -0700)

are available in the Git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/modules/linux.git tags/modules-7.1-rc1

for you to fetch changes up to 663385f9155f27892a97a5824006f806a32eb8dc:

module: Simplify warning on positive returns from module_init() (2026-04-04 00:04:48 +0000)

----------------------------------------------------------------
Modules changes for v7.1-rc1

Kernel symbol flags:

- Replace the separate *_gpl symbol sections (__ksymtab_gpl and __kcrctab_gpl) with a unified symbol table and a new __kflagstab section. This section stores symbol flags, such as the GPL-only flag, as an 8-bit bitset for each exported symbol. This is a cleanup that simplifies symbol lookup in the module loader by avoiding table fragmentation and will allow a cleaner way to add more flags later if needed.

Module signature UAPI:

- Move struct module_signature to the UAPI headers to allow reuse by tools outside the kernel proper, such as kmod and scripts/sign-file. This also renames a few constants for clarity and drops unused signature types as preparation for hash-based module integrity checking work that's in progress.

Sysfs:

- Add a /sys/module/<module>/import_ns sysfs attribute to show the symbol namespaces imported by loaded modules. This makes it easier to verify driver API access at runtime on systems that care about such things (e.g. Android).

Cleanups and fixes:

- Force sh_addr to 0 for all sections in module.lds. This prevents non-zero section addresses when linking modules with ld.bfd -r, which confused elfutils.

- Fix a memory leak of charp module parameters on module unload when the kernel is configured with CONFIG_SYSFS=n.

- Override the -EEXIST error code returned by module_init() to userspace. This prevents confusion with the errno reserved by the module loader to indicate that a module is already loaded.

- Simplify the warning message and drop the stack dump on positive returns from module_init().

- Drop unnecessary extern keywords from function declarations and synchronize parse_args() arguments with their implementation.

----------------------------------------------------------------
Conflicts:

There is a small merge conflict in scripts/module.lds.S between the parisc tree, where the commit

eab5a8054a5cf ("module.lds.S: Fix modules on 32-bit parisc architecture")

conflicts with

4afc71bba8b7 ("module.lds,codetag: force 0 sh_addr for sections")

----------------------------------------------------------------
Joe Lawrence (1):
module.lds,codetag: force 0 sh_addr for sections

Lucas De Marchi (2):
module: Override -EEXIST module return
module: Simplify warning on positive returns from module_init()

Nicholas Sielicki (2):
module: expose imported namespaces via sysfs
docs: symbol-namespaces: mention sysfs attribute

Petr Pavlu (3):
module: Fix freeing of charp module parameters when CONFIG_SYSFS=n
module: Clean up parse_args() arguments
module: Remove extern keyword from param prototypes

Siddharth Nayyar (7):
module: define ksym_flags enumeration to represent kernel symbol flags
module: add kflagstab section to vmlinux and modules
module: populate kflagstab in modpost
module: use kflagstab instead of *_gpl sections
module: deprecate usage of *_gpl sections in module loader
module: remove *_gpl sections from vmlinux and modules
documentation: remove references to *_gpl sections

Thomas Weißschuh (8):
extract-cert: drop unused definition of PKEY_ID_PKCS7
module: Drop unused signature types
module: Give 'enum pkey_id_type' a more specific name
module: Give MODULE_SIG_STRING a more descriptive name
module: Move 'struct module_signature' to UAPI
tools uapi headers: add linux/module_signature.h
sign-file: use 'struct module_signature' from the UAPI headers selftests/bpf: verify_pkcs7_sig: Use 'struct module_signature' from the UAPI headers

 Documentation/ABI/testing/sysfs-module             |   9 +
 Documentation/core-api/symbol-namespaces.rst       |   5 +
 Documentation/kbuild/modules.rst                   |  11 +-
 arch/s390/kernel/machine_kexec_file.c              |   6 +-
 certs/extract-cert.c                               |   2 -
 include/asm-generic/codetag.lds.h                  |   2 +-
 include/asm-generic/vmlinux.lds.h                  |  21 +--
 include/linux/export-internal.h                    |  28 +--
 include/linux/module.h                             |   5 +-
 include/linux/module_signature.h                   |  30 +---
 include/linux/module_symbol.h                      |   5 +
 include/linux/moduleparam.h                        | 100 +++++------
 include/uapi/linux/module_signature.h              |  41 +++++
 kernel/module/internal.h                           |   4 +-
 kernel/module/main.c                               | 192 ++++++++++++++-------
 kernel/module/signing.c                            |   4 +-
 kernel/module_signature.c                          |   2 +-
 kernel/params.c                                    |  29 ++--
 scripts/Makefile                                   |   1 +
 scripts/mod/modpost.c                              |  16 +-
 scripts/module.lds.S                               |  15 +-
 scripts/sign-file.c                                |  19 +-
 security/integrity/ima/ima_modsig.c                |   6 +-
 tools/include/uapi/linux/module_signature.h        |  41 +++++
 tools/testing/selftests/bpf/Makefile               |   1 +
 .../selftests/bpf/prog_tests/verify_pkcs7_sig.c    |  28 +--
 26 files changed, 368 insertions(+), 255 deletions(-)
 create mode 100644 include/uapi/linux/module_signature.h
 create mode 100644 tools/include/uapi/linux/module_signature.h
merge bot Merged
#1 lore raw
The pull request you sent on Mon, 13 Apr 2026 00:26:14 +0000:

The pull request you sent on Mon, 13 Apr 2026 00:26:14 +0000:

Quoted 1 line

git://git.kernel.org/pub/scm/linux/kernel/git/modules/linux.git tags/modules-7.1-rc1

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/88b29f3f579987fff0d2bd726d5fa95a53f857fa

Thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/prtracker.html