diff options
| author | Mark Brown <broonie@kernel.org> | 2026-10-14 14:20:03 +0100 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2026-10-14 14:20:03 +0100 |
| commit | e4622b8294abcb690ce7c8587bc8a49d14d2ef01 (patch) | |
| tree | cf31370df373f06a1268a5f8a86b09d6f22c1d28 /kernel | |
| parent | baa5f780c1804c1d0e8c4e918970ef3221c2e7e6 (diff) | |
| parent | 08abfa5a161e1b6e6244cb2090b0530bc0920798 (diff) | |
| download | linux-next-e4622b8294abcb690ce7c8587bc8a49d14d2ef01.tar.gz linux-next-e4622b8294abcb690ce7c8587bc8a49d14d2ef01.zip | |
Merge branch 'modules-next' of https://git.kernel.org/pub/scm/linux/kernel/git/modules/linux.git
# Conflicts:
# drivers/gpu/drm/clients/drm_fbdev_helper.c
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/cgroup/cgroup-v1.c | 2 | ||||
| -rw-r--r-- | kernel/module/kallsyms.c | 59 | ||||
| -rw-r--r-- | kernel/module/kmod.c | 3 | ||||
| -rw-r--r-- | kernel/module/main.c | 1 | ||||
| -rw-r--r-- | kernel/module/tracking.c | 2 | ||||
| -rw-r--r-- | kernel/power/process.c | 2 | ||||
| -rw-r--r-- | kernel/reboot.c | 2 | ||||
| -rw-r--r-- | kernel/time/jiffies.c | 1 | ||||
| -rw-r--r-- | kernel/umh.c | 2 |
9 files changed, 40 insertions, 34 deletions
diff --git a/kernel/cgroup/cgroup-v1.c b/kernel/cgroup/cgroup-v1.c index a4337c9b5287..cbcde5c28b18 100644 --- a/kernel/cgroup/cgroup-v1.c +++ b/kernel/cgroup/cgroup-v1.c @@ -2,7 +2,7 @@ #include "cgroup-internal.h" #include <linux/ctype.h> -#include <linux/kmod.h> +#include <linux/umh.h> #include <linux/sort.h> #include <linux/delay.h> #include <linux/mm.h> diff --git a/kernel/module/kallsyms.c b/kernel/module/kallsyms.c index f23126d804b2..1ff8ce857d92 100644 --- a/kernel/module/kallsyms.c +++ b/kernel/module/kallsyms.c @@ -75,23 +75,29 @@ static char elf_type(const Elf_Sym *sym, const struct load_info *info) return '?'; } -static bool is_core_symbol(const Elf_Sym *src, const Elf_Shdr *sechdrs, - unsigned int shnum, unsigned int pcpundx) +static bool is_core_symbol(struct module *mod, const struct load_info *info, + unsigned int symnum, const Elf_Sym *src) { const Elf_Shdr *sec; enum mod_mem_type type; + if (symnum == 0 || is_livepatch_module(mod)) + return true; + if (src->st_shndx == SHN_UNDEF || - src->st_shndx >= shnum || + src->st_shndx >= info->hdr->e_shnum || !src->st_name) return false; + if (is_ignored_kernel_symbol(&info->strtab[src->st_name])) + return false; + #ifdef CONFIG_KALLSYMS_ALL - if (src->st_shndx == pcpundx) + if (src->st_shndx == info->index.pcpu) return true; #endif - sec = sechdrs + src->st_shndx; + sec = info->sechdrs + src->st_shndx; type = sec->sh_entsize >> SH_ENTSIZE_TYPE_SHIFT; if (!(sec->sh_flags & SHF_ALLOC) #ifndef CONFIG_KALLSYMS_ALL @@ -130,12 +136,11 @@ void layout_symtab(struct module *mod, struct load_info *info) /* Compute total space required for the core symbols' strtab. */ for (ndst = i = 0; i < nsrc; i++) { - if (i == 0 || is_livepatch_module(mod) || - is_core_symbol(src + i, info->sechdrs, info->hdr->e_shnum, - info->index.pcpu)) { - strtab_size += strlen(&info->strtab[src[i].st_name]) + 1; - ndst++; - } + if (!is_core_symbol(mod, info, i, src + i)) + continue; + + strtab_size += strlen(&info->strtab[src[i].st_name]) + 1; + ndst++; } /* Append room for core symbols at end of core part. */ @@ -197,23 +202,21 @@ void add_kallsyms(struct module *mod, const struct load_info *info) strtab_size = info->core_typeoffs - info->stroffs; src = kallsyms->symtab; for (ndst = i = 0; i < kallsyms->num_symtab; i++) { + ssize_t ret; + kallsyms->typetab[i] = elf_type(src + i, info); - if (i == 0 || is_livepatch_module(mod) || - is_core_symbol(src + i, info->sechdrs, info->hdr->e_shnum, - info->index.pcpu)) { - ssize_t ret; - - mod->core_kallsyms.typetab[ndst] = - kallsyms->typetab[i]; - dst[ndst] = src[i]; - dst[ndst++].st_name = s - mod->core_kallsyms.strtab; - ret = strscpy(s, &kallsyms->strtab[src[i].st_name], - strtab_size); - if (ret < 0) - break; - s += ret + 1; - strtab_size -= ret + 1; - } + + if (!is_core_symbol(mod, info, i, src + i)) + continue; + + mod->core_kallsyms.typetab[ndst] = kallsyms->typetab[i]; + dst[ndst] = src[i]; + dst[ndst++].st_name = s - mod->core_kallsyms.strtab; + ret = strscpy(s, &kallsyms->strtab[src[i].st_name], strtab_size); + if (ret < 0) + break; + s += ret + 1; + strtab_size -= ret + 1; } /* Set up to point into init section. */ @@ -294,7 +297,7 @@ static const char *find_kallsyms_symbol(struct module *mod, * and inserted at a whim. */ if (*kallsyms_symbol_name(kallsyms, i) == '\0' || - is_mapping_symbol(kallsyms_symbol_name(kallsyms, i))) + is_ignored_kernel_symbol(kallsyms_symbol_name(kallsyms, i))) continue; if (thisval <= addr && thisval > bestval) { diff --git a/kernel/module/kmod.c b/kernel/module/kmod.c index a25dccdf7aa7..24091210741e 100644 --- a/kernel/module/kmod.c +++ b/kernel/module/kmod.c @@ -28,6 +28,7 @@ #include <linux/ptrace.h> #include <linux/async.h> #include <linux/uaccess.h> +#include <linux/umh.h> #include <trace/events/module.h> #include "internal.h" @@ -81,7 +82,7 @@ static int call_modprobe(char *orig_module_name, int wait) char *module_name; int ret; - char **argv = kmalloc(sizeof(char *[5]), GFP_KERNEL); + char **argv = kmalloc_array(5, sizeof(*argv), GFP_KERNEL); if (!argv) goto out; diff --git a/kernel/module/main.c b/kernel/module/main.c index 5b9eb56164b2..1e02134a66dc 100644 --- a/kernel/module/main.c +++ b/kernel/module/main.c @@ -60,6 +60,7 @@ #include <linux/codetag.h> #include <linux/debugfs.h> #include <linux/execmem.h> +#include <linux/error-injection.h> #include <uapi/linux/module.h> #include "internal.h" diff --git a/kernel/module/tracking.c b/kernel/module/tracking.c index 9033ff54c4e2..9e8902600c32 100644 --- a/kernel/module/tracking.c +++ b/kernel/module/tracking.c @@ -38,8 +38,8 @@ int try_add_tainted_module(struct module *mod) return -ENOMEM; strscpy(mod_taint->name, mod->name, MODULE_NAME_LEN); mod_taint->taints = mod->taints; - list_add_rcu(&mod_taint->list, &unloaded_tainted_modules); mod_taint->count = 1; + list_add_rcu(&mod_taint->list, &unloaded_tainted_modules); out: return 0; } diff --git a/kernel/power/process.c b/kernel/power/process.c index dc0dfc349f22..295904ec9a82 100644 --- a/kernel/power/process.c +++ b/kernel/power/process.c @@ -16,7 +16,7 @@ #include <linux/freezer.h> #include <linux/delay.h> #include <linux/workqueue.h> -#include <linux/kmod.h> +#include <linux/umh.h> #include <trace/events/power.h> #include <linux/cpuset.h> diff --git a/kernel/reboot.c b/kernel/reboot.c index 5b9691f45f5f..a93c23b9e194 100644 --- a/kernel/reboot.c +++ b/kernel/reboot.c @@ -12,7 +12,6 @@ #include <linux/ctype.h> #include <linux/export.h> #include <linux/kexec.h> -#include <linux/kmod.h> #include <linux/kmsg_dump.h> #include <linux/rcupdate.h> #include <linux/reboot.h> @@ -21,6 +20,7 @@ #include <linux/syscalls.h> #include <linux/syscore_ops.h> #include <linux/uaccess.h> +#include <linux/umh.h> /* * this indicates whether you can reboot with ctrl-alt-del: the default is yes diff --git a/kernel/time/jiffies.c b/kernel/time/jiffies.c index 9b3487d40cd6..af1c69bf0c23 100644 --- a/kernel/time/jiffies.c +++ b/kernel/time/jiffies.c @@ -8,6 +8,7 @@ #include <linux/jiffies.h> #include <linux/module.h> #include <linux/init.h> +#include <linux/sysctl.h> #include "timekeeping.h" #include "tick-internal.h" diff --git a/kernel/umh.c b/kernel/umh.c index 6e2c7bb315c6..512dc018a50b 100644 --- a/kernel/umh.c +++ b/kernel/umh.c @@ -8,7 +8,7 @@ #include <linux/binfmts.h> #include <linux/syscalls.h> #include <linux/unistd.h> -#include <linux/kmod.h> +#include <linux/umh.h> #include <linux/slab.h> #include <linux/completion.h> #include <linux/cred.h> |
