Skip to content

Draft: module: Sync with upstream to v6.0-rc1

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2124824 Build: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=48122021 Tested: Compile and boot only

This series is based on tag modules-6.0-rc1 [1] which is similar to Linus' v6.0-rc1 yet excludes kunit related work. Please note, I plan to prepare a RHEL-only patch/or deviation from upstream: enabled Kconfig option CONFIG_MODULE_UNLOAD_TAINT_TRACKING to allow us to maintain a permanent record of each unloaded module that taints the kernel (see Linus' commit 99bd9956 "module: Introduce module unload taint tracking").

1: git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux.git

Aaron Tomlin (59): MAINTAINERS: Add Luis Chamberlain as modules maintainer module: fix clang CFI with MODULE_UNLOAD=n module: fix validate_section_offset() overflow bug on 64-bit module: change to print useful messages from elf_validity_check() livepatch: Avoid CPU hogging with cond_resched module: Remove outdated comment MAINTAINERS: Remove myself as modules maintainer module: add in-kernel support for decompressing MAINTAINERS: add mailing lists for kmod and modules kernel: Fix spelling mistake "compresser" -> "compressor" module: fix signature check failures when using in-kernel decompression Revert "module, async: async_synchronize_full() on module init iff async is used" module: fix building with sysfs disabled module: Move all into module/ module: Simple refactor in preparation for split module: Make internal.h and decompress.c more compliant module: Move livepatch support to a separate file module: Move latched RB-tree support to a separate file module: Move strict rwx support to a separate file module: Move extra signature support out of core code module: Move kmemleak support to a separate file module: Move kallsyms support into a separate file module: kallsyms: Fix suspicious rcu usage module: Move procfs support into a separate file module: Move sysfs support into a separate file module: Move kdb module related code out of main kdb code module: Move version support into a separate file module: Make module_enable_x() independent of CONFIG_ARCH_HAS_STRICT_MODULE_RWX module: Move module_enable_x() and frob_text() in strict_rwx.c module: Rework layout alignment to avoid BUG_ON()s module: Rename debug_align() as strict_align() module: Always have struct mod_tree_root module: Prepare for handling several RB trees module: Introduce data_layout module: Add CONFIG_ARCH_WANTS_MODULES_DATA_IN_VMALLOC module: Remove module_addr_min and module_addr_max module: Make module_flags_taint() accept a module's taints bitmap and usable outside core code module: Move module_assert_mutex_or_preempt() to internal.h module: Introduce module unload taint tracking module: fix [e_shstrndx].sh_size=0 OOB access module: show disallowed symbol name for inherit_taint() module: do not pass opaque pointer for symbol search module: do not binary-search in __ksymtab_gpl if fsa->gplok is false module: merge check_exported_symbol() into find_exported_symbol_in_section() module: Fix prefix for module.sig_enforce module param modules: Fix corruption of /proc/kallsyms module: Fix selfAssignment cppcheck warning module: Fix "warning: variable 'exit' set but not used" module: kallsyms: Ensure preemption in add_kallsyms() with PREEMPT_RT module: Add support for default value for module async_probe module: Fix ERRORs reported by checkpatch.pl module: Increase readability of module_kallsyms_lookup_name() module: Use vzalloc() instead of vmalloc()/memset(0) module: Move module's Kconfig items in kernel/module/ module: Modify module_flags() to accept show_state argument module: Use strscpy() for last_unloaded_module module: Show the last unloaded module's taint flag(s) module: Replace kmap() with kmap_local_page() module: tracking: Keep a record of tainted unloaded modules only

.../admin-guide/kernel-parameters.txt         |   17 +-
MAINTAINERS                                   |   11 +-
arch/Kconfig                                  |    6 +
include/linux/kdb.h                           |    1 +
include/linux/module.h                        |   29 +-
include/linux/sched.h                         |    1 -
include/uapi/linux/module.h                   |    1 +
init/Kconfig                                  |  273 +-
kernel/Makefile                               |    4 +-
kernel/async.c                                |    3 -
kernel/debug/kdb/kdb_io.c                     |    1 -
kernel/debug/kdb/kdb_keyboard.c               |    1 -
kernel/debug/kdb/kdb_main.c                   |   49 -
kernel/debug/kdb/kdb_private.h                |    4 -
kernel/debug/kdb/kdb_support.c                |    1 -
kernel/kallsyms.c                             |    1 +
kernel/module-internal.h                      |   31 -
kernel/module/Kconfig                         |  297 +++
kernel/module/Makefile                        |   21 +
kernel/module/debug_kmemleak.c                |   30 +
kernel/module/decompress.c                    |  276 ++
kernel/module/internal.h                      |  305 +++
kernel/module/kallsyms.c                      |  534 ++++
kernel/module/kdb.c                           |   62 +
kernel/module/livepatch.c                     |   74 +
kernel/{module.c => module/main.c}            | 2218 +++--------------
kernel/module/procfs.c                        |  146 ++
kernel/module/signing.c                       |  132 +
kernel/module/strict_rwx.c                    |  143 ++
kernel/module/sysfs.c                         |  436 ++++
kernel/module/tracking.c                      |   64 +
kernel/module/tree_lookup.c                   |  117 +
kernel/module/version.c                       |  109 +
kernel/module_signing.c                       |   52 -
.../CONFIG_MODULE_UNLOAD_TAINT_TRACKING       |    1 +
35 files changed, 3097 insertions(+), 2354 deletions(-)
delete mode 100644 kernel/module-internal.h
create mode 100644 kernel/module/Kconfig
create mode 100644 kernel/module/Makefile
create mode 100644 kernel/module/debug_kmemleak.c
create mode 100644 kernel/module/decompress.c
create mode 100644 kernel/module/internal.h
create mode 100644 kernel/module/kallsyms.c
create mode 100644 kernel/module/kdb.c
create mode 100644 kernel/module/livepatch.c
rename kernel/{module.c => module/main.c} (59%)
create mode 100644 kernel/module/procfs.c
create mode 100644 kernel/module/signing.c
create mode 100644 kernel/module/strict_rwx.c
create mode 100644 kernel/module/sysfs.c
create mode 100644 kernel/module/tracking.c
create mode 100644 kernel/module/tree_lookup.c
create mode 100644 kernel/module/version.c
delete mode 100644 kernel/module_signing.c
create mode 100644 redhat/configs/common/generic/CONFIG_MODULE_UNLOAD_TAINT_TRACKING

Signed-off-by: Aaron Tomlin atomlin@redhat.com

Edited by Aaron Tomlin

Merge request reports