linux/kernel/module
Thiébaud Weksteen 9a5ff45689 module: validate string table section types
In elf_validity_cache_sechdrs, section sizes and offsets are validated,
unless the section type is SHT_NULL or SHT_NOBITS.

Later, elf_validity_cache_secstrings and elf_validity_cache_index_str
access the section name table (.shstrtab) and symbol string table
(.strtab) headers without first ensuring that their types are
SHT_STRTAB. If a section type is SHT_NULL or SHT_NOBITS, sh_offset has
not been validated and may reference out-of-bounds memory when
dereferenced in elf_validity_cache_secstrings or
elf_validity_cache_strtab.

Validate that both string section headers are of type SHT_STRTAB before
caching them.

Cc: stable@vger.kernel.org
Signed-off-by: Thiébaud Weksteen <tweek@google.com>
Reviewed-by: Aaron Tomlin <atomlin@atomlin.com>
Reviewed-by: Petr Pavlu <petr.pavlu@suse.com>
Signed-off-by: Petr Pavlu <petr.pavlu@suse.com>
2026-08-06 16:44:45 +02:00
..
debug_kmemleak.c module: prepare to handle ROX allocations for text 2024-11-07 14:25:15 -08:00
decompress.c module: decompress: check return value of module_extend_max_pages() 2026-06-04 16:37:32 +00:00
dups.c module/dups: Clean up includes 2026-08-06 13:29:03 +02:00
internal.h module: deprecate usage of *_gpl sections in module loader 2026-03-31 23:42:52 +00:00
kallsyms.c module/kallsyms: fix nextval for data symbol lookup 2026-08-06 13:27:35 +02:00
Kconfig module: Fix the modversions and signing submenus 2026-02-23 17:45:03 +00:00
kdb.c
kmod.c kernel: modules: Add SPDX license identifier to kmod.c 2026-01-15 16:58:28 -08:00
livepatch.c
main.c module: validate string table section types 2026-08-06 16:44:45 +02:00
Makefile module: Fix KCOV-ignored file name 2024-08-08 17:36:35 +02:00
procfs.c module: procfs: use matching type for accumulator in module_total_size() 2026-08-06 13:29:02 +02:00
signing.c module: Give MODULE_SIG_STRING a more descriptive name 2026-03-24 21:42:37 +00:00
stats.c module: use strscpy() to copy module names in stats and dup tracking 2026-08-06 13:29:02 +02:00
strict_rwx.c module: Make .static_call_sites read-only after init 2025-05-18 13:56:22 +02:00
sysfs.c Convert 'alloc_flex' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
tracking.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
tree_lookup.c kcfi: Rename CONFIG_CFI_CLANG to CONFIG_CFI 2025-09-24 14:29:14 -07:00
version.c module: Use RCU in find_symbol(). 2025-03-10 11:54:44 +01:00