Lines Matching refs:info
356 static unsigned int find_sec(const struct load_info *info, const char *name) in find_sec() argument
360 for (i = 1; i < info->hdr->e_shnum; i++) { in find_sec()
361 Elf_Shdr *shdr = &info->sechdrs[i]; in find_sec()
364 && strcmp(info->secstrings + shdr->sh_name, name) == 0) in find_sec()
371 static void *section_addr(const struct load_info *info, const char *name) in section_addr() argument
374 return (void *)info->sechdrs[find_sec(info, name)].sh_addr; in section_addr()
378 static void *section_objs(const struct load_info *info, in section_objs() argument
383 unsigned int sec = find_sec(info, name); in section_objs()
386 *num = info->sechdrs[sec].sh_size / object_size; in section_objs()
387 return (void *)info->sechdrs[sec].sh_addr; in section_objs()
659 static int percpu_modalloc(struct module *mod, struct load_info *info) in percpu_modalloc() argument
661 Elf_Shdr *pcpusec = &info->sechdrs[info->index.pcpu]; in percpu_modalloc()
688 static unsigned int find_pcpusec(struct load_info *info) in find_pcpusec() argument
690 return find_sec(info, ".data..percpu"); in find_pcpusec()
755 static int percpu_modalloc(struct module *mod, struct load_info *info) in percpu_modalloc() argument
758 if (info->sechdrs[info->index.pcpu].sh_size != 0) in percpu_modalloc()
765 static unsigned int find_pcpusec(struct load_info *info) in find_pcpusec() argument
1311 static int check_version(const struct load_info *info, in check_version() argument
1316 Elf_Shdr *sechdrs = info->sechdrs; in check_version()
1317 unsigned int versindex = info->index.vers; in check_version()
1351 pr_warn_once("%s: no symbol version for %s\n", info->name, symname); in check_version()
1356 info->name, symname); in check_version()
1360 static inline int check_modstruct_version(const struct load_info *info, in check_modstruct_version() argument
1375 return check_version(info, "module_layout", mod, crc); in check_modstruct_version()
1389 static inline int check_version(const struct load_info *info, in check_version() argument
1397 static inline int check_modstruct_version(const struct load_info *info, in check_modstruct_version() argument
1410 static char *get_modinfo(const struct load_info *info, const char *tag);
1411 static char *get_next_modinfo(const struct load_info *info, const char *tag,
1414 static int verify_namespace_is_imported(const struct load_info *info, in verify_namespace_is_imported() argument
1423 imported_namespace = get_modinfo(info, "import_ns"); in verify_namespace_is_imported()
1428 info, "import_ns", imported_namespace); in verify_namespace_is_imported()
1465 const struct load_info *info, in resolve_symbol() argument
1495 if (!check_version(info, name, mod, crc)) { in resolve_symbol()
1500 err = verify_namespace_is_imported(info, sym, mod); in resolve_symbol()
1522 const struct load_info *info, in resolve_symbol_wait() argument
1529 !IS_ERR(ksym = resolve_symbol(mod, info, name, owner)) in resolve_symbol_wait()
1600 static void add_sect_attrs(struct module *mod, const struct load_info *info) in add_sect_attrs() argument
1608 for (i = 0; i < info->hdr->e_shnum; i++) in add_sect_attrs()
1609 if (!sect_empty(&info->sechdrs[i])) in add_sect_attrs()
1625 for (i = 0; i < info->hdr->e_shnum; i++) { in add_sect_attrs()
1626 Elf_Shdr *sec = &info->sechdrs[i]; in add_sect_attrs()
1632 kstrdup(info->secstrings + sec->sh_name, GFP_KERNEL); in add_sect_attrs()
1697 static void add_notes_attrs(struct module *mod, const struct load_info *info) in add_notes_attrs() argument
1709 for (i = 0; i < info->hdr->e_shnum; i++) in add_notes_attrs()
1710 if (!sect_empty(&info->sechdrs[i]) && in add_notes_attrs()
1711 (info->sechdrs[i].sh_type == SHT_NOTE)) in add_notes_attrs()
1724 for (loaded = i = 0; i < info->hdr->e_shnum; ++i) { in add_notes_attrs()
1725 if (sect_empty(&info->sechdrs[i])) in add_notes_attrs()
1727 if (info->sechdrs[i].sh_type == SHT_NOTE) { in add_notes_attrs()
1731 nattr->size = info->sechdrs[i].sh_size; in add_notes_attrs()
1732 nattr->private = (void *) info->sechdrs[i].sh_addr; in add_notes_attrs()
1764 const struct load_info *info) in add_sect_attrs() argument
1773 const struct load_info *info) in add_notes_attrs() argument
1911 const struct load_info *info, in mod_sysfs_setup() argument
1939 add_sect_attrs(mod, info); in mod_sysfs_setup()
1940 add_notes_attrs(mod, info); in mod_sysfs_setup()
1970 const struct load_info *info, in mod_sysfs_setup() argument
2133 static int copy_module_elf(struct module *mod, struct load_info *info) in copy_module_elf() argument
2145 memcpy(&mod->klp_info->hdr, info->hdr, size); in copy_module_elf()
2148 size = sizeof(*info->sechdrs) * info->hdr->e_shnum; in copy_module_elf()
2149 mod->klp_info->sechdrs = kmemdup(info->sechdrs, size, GFP_KERNEL); in copy_module_elf()
2156 size = info->sechdrs[info->hdr->e_shstrndx].sh_size; in copy_module_elf()
2157 mod->klp_info->secstrings = kmemdup(info->secstrings, size, GFP_KERNEL); in copy_module_elf()
2164 symndx = info->index.sym; in copy_module_elf()
2192 static int copy_module_elf(struct module *mod, struct load_info *info) in copy_module_elf() argument
2375 static int simplify_symbols(struct module *mod, const struct load_info *info) in simplify_symbols() argument
2377 Elf_Shdr *symsec = &info->sechdrs[info->index.sym]; in simplify_symbols()
2385 const char *name = info->strtab + sym[i].st_name; in simplify_symbols()
2412 ksym = resolve_symbol_wait(mod, info, name); in simplify_symbols()
2422 ignore_undef_symbol(info->hdr->e_machine, name))) in simplify_symbols()
2432 if (sym[i].st_shndx == info->index.pcpu) in simplify_symbols()
2435 secbase = info->sechdrs[sym[i].st_shndx].sh_addr; in simplify_symbols()
2444 static int apply_relocations(struct module *mod, const struct load_info *info) in apply_relocations() argument
2450 for (i = 1; i < info->hdr->e_shnum; i++) { in apply_relocations()
2451 unsigned int infosec = info->sechdrs[i].sh_info; in apply_relocations()
2454 if (infosec >= info->hdr->e_shnum) in apply_relocations()
2458 if (!(info->sechdrs[infosec].sh_flags & SHF_ALLOC)) in apply_relocations()
2461 if (info->sechdrs[i].sh_flags & SHF_RELA_LIVEPATCH) in apply_relocations()
2462 err = klp_apply_section_relocs(mod, info->sechdrs, in apply_relocations()
2463 info->secstrings, in apply_relocations()
2464 info->strtab, in apply_relocations()
2465 info->index.sym, i, in apply_relocations()
2467 else if (info->sechdrs[i].sh_type == SHT_REL) in apply_relocations()
2468 err = apply_relocate(info->sechdrs, info->strtab, in apply_relocations()
2469 info->index.sym, i, mod); in apply_relocations()
2470 else if (info->sechdrs[i].sh_type == SHT_RELA) in apply_relocations()
2471 err = apply_relocate_add(info->sechdrs, info->strtab, in apply_relocations()
2472 info->index.sym, i, mod); in apply_relocations()
2503 static void layout_sections(struct module *mod, struct load_info *info) in layout_sections() argument
2517 for (i = 0; i < info->hdr->e_shnum; i++) in layout_sections()
2518 info->sechdrs[i].sh_entsize = ~0UL; in layout_sections()
2522 for (i = 0; i < info->hdr->e_shnum; ++i) { in layout_sections()
2523 Elf_Shdr *s = &info->sechdrs[i]; in layout_sections()
2524 const char *sname = info->secstrings + s->sh_name; in layout_sections()
2555 for (i = 0; i < info->hdr->e_shnum; ++i) { in layout_sections()
2556 Elf_Shdr *s = &info->sechdrs[i]; in layout_sections()
2557 const char *sname = info->secstrings + s->sh_name; in layout_sections()
2624 static char *get_next_modinfo(const struct load_info *info, const char *tag, in get_next_modinfo() argument
2629 Elf_Shdr *infosec = &info->sechdrs[info->index.info]; in get_next_modinfo()
2636 char *modinfo = (char *)info->hdr + infosec->sh_offset; in get_next_modinfo()
2650 static char *get_modinfo(const struct load_info *info, const char *tag) in get_modinfo() argument
2652 return get_next_modinfo(info, tag, NULL); in get_modinfo()
2655 static void setup_modinfo(struct module *mod, struct load_info *info) in setup_modinfo() argument
2662 attr->setup(mod, get_modinfo(info, attr->attr.name)); in setup_modinfo()
2701 static char elf_type(const Elf_Sym *sym, const struct load_info *info) in elf_type() argument
2703 const Elf_Shdr *sechdrs = info->sechdrs; in elf_type()
2713 if (sym->st_shndx == SHN_ABS || sym->st_shndx == info->index.pcpu) in elf_type()
2734 if (strstarts(info->secstrings + sechdrs[sym->st_shndx].sh_name, in elf_type()
2774 static void layout_symtab(struct module *mod, struct load_info *info) in layout_symtab() argument
2776 Elf_Shdr *symsect = info->sechdrs + info->index.sym; in layout_symtab()
2777 Elf_Shdr *strsect = info->sechdrs + info->index.str; in layout_symtab()
2784 info->index.sym) | INIT_OFFSET_MASK; in layout_symtab()
2785 pr_debug("\t%s\n", info->secstrings + symsect->sh_name); in layout_symtab()
2787 src = (void *)info->hdr + symsect->sh_offset; in layout_symtab()
2793 is_core_symbol(src+i, info->sechdrs, info->hdr->e_shnum, in layout_symtab()
2794 info->index.pcpu)) { in layout_symtab()
2795 strtab_size += strlen(&info->strtab[src[i].st_name])+1; in layout_symtab()
2801 info->symoffs = ALIGN(mod->core_layout.size, symsect->sh_addralign ?: 1); in layout_symtab()
2802 info->stroffs = mod->core_layout.size = info->symoffs + ndst * sizeof(Elf_Sym); in layout_symtab()
2804 info->core_typeoffs = mod->core_layout.size; in layout_symtab()
2811 info->index.str) | INIT_OFFSET_MASK; in layout_symtab()
2812 pr_debug("\t%s\n", info->secstrings + strsect->sh_name); in layout_symtab()
2817 info->mod_kallsyms_init_off = mod->init_layout.size; in layout_symtab()
2819 info->init_typeoffs = mod->init_layout.size; in layout_symtab()
2829 static void add_kallsyms(struct module *mod, const struct load_info *info) in add_kallsyms() argument
2835 Elf_Shdr *symsec = &info->sechdrs[info->index.sym]; in add_kallsyms()
2838 mod->kallsyms = mod->init_layout.base + info->mod_kallsyms_init_off; in add_kallsyms()
2843 mod->kallsyms->strtab = (void *)info->sechdrs[info->index.str].sh_addr; in add_kallsyms()
2844 mod->kallsyms->typetab = mod->init_layout.base + info->init_typeoffs; in add_kallsyms()
2850 mod->core_kallsyms.symtab = dst = mod->core_layout.base + info->symoffs; in add_kallsyms()
2851 mod->core_kallsyms.strtab = s = mod->core_layout.base + info->stroffs; in add_kallsyms()
2852 mod->core_kallsyms.typetab = mod->core_layout.base + info->core_typeoffs; in add_kallsyms()
2855 mod->kallsyms->typetab[i] = elf_type(src + i, info); in add_kallsyms()
2857 is_core_symbol(src+i, info->sechdrs, info->hdr->e_shnum, in add_kallsyms()
2858 info->index.pcpu)) { in add_kallsyms()
2870 static inline void layout_symtab(struct module *mod, struct load_info *info) in layout_symtab() argument
2874 static void add_kallsyms(struct module *mod, const struct load_info *info) in add_kallsyms() argument
2911 const struct load_info *info) in kmemleak_load_module() argument
2918 for (i = 1; i < info->hdr->e_shnum; i++) { in kmemleak_load_module()
2920 if (!(info->sechdrs[i].sh_flags & SHF_ALLOC) || in kmemleak_load_module()
2921 !(info->sechdrs[i].sh_flags & SHF_WRITE) || in kmemleak_load_module()
2922 (info->sechdrs[i].sh_flags & SHF_EXECINSTR)) in kmemleak_load_module()
2925 kmemleak_scan_area((void *)info->sechdrs[i].sh_addr, in kmemleak_load_module()
2926 info->sechdrs[i].sh_size, GFP_KERNEL); in kmemleak_load_module()
2931 const struct load_info *info) in kmemleak_load_module() argument
2937 static int module_sig_check(struct load_info *info, int flags) in module_sig_check() argument
2942 const void *mod = info->hdr; in module_sig_check()
2949 info->len > markerlen && in module_sig_check()
2950 memcmp(mod + info->len - markerlen, MODULE_SIG_STRING, markerlen) == 0) { in module_sig_check()
2952 info->len -= markerlen; in module_sig_check()
2953 err = mod_verify_sig(mod, info); in module_sig_check()
2958 info->sig_ok = true; in module_sig_check()
2991 static int module_sig_check(struct load_info *info, int flags) in module_sig_check() argument
2997 static int validate_section_offset(struct load_info *info, Elf_Shdr *shdr) in validate_section_offset() argument
3006 if (secend < shdr->sh_offset || secend > info->len) in validate_section_offset()
3018 static int elf_validity_check(struct load_info *info) in elf_validity_check() argument
3024 if (info->len < sizeof(*(info->hdr))) in elf_validity_check()
3027 if (memcmp(info->hdr->e_ident, ELFMAG, SELFMAG) != 0 in elf_validity_check()
3028 || info->hdr->e_type != ET_REL in elf_validity_check()
3029 || !elf_check_arch(info->hdr) in elf_validity_check()
3030 || info->hdr->e_shentsize != sizeof(Elf_Shdr)) in elf_validity_check()
3038 if (info->hdr->e_shoff >= info->len in elf_validity_check()
3039 || (info->hdr->e_shnum * sizeof(Elf_Shdr) > in elf_validity_check()
3040 info->len - info->hdr->e_shoff)) in elf_validity_check()
3043 info->sechdrs = (void *)info->hdr + info->hdr->e_shoff; in elf_validity_check()
3048 if (info->hdr->e_shstrndx == SHN_UNDEF in elf_validity_check()
3049 || info->hdr->e_shstrndx >= info->hdr->e_shnum) in elf_validity_check()
3052 strhdr = &info->sechdrs[info->hdr->e_shstrndx]; in elf_validity_check()
3053 err = validate_section_offset(info, strhdr); in elf_validity_check()
3062 info->secstrings = (void *)info->hdr + strhdr->sh_offset; in elf_validity_check()
3063 if (info->secstrings[strhdr->sh_size - 1] != '\0') in elf_validity_check()
3070 if (info->sechdrs[0].sh_type != SHT_NULL in elf_validity_check()
3071 || info->sechdrs[0].sh_size != 0 in elf_validity_check()
3072 || info->sechdrs[0].sh_addr != 0) in elf_validity_check()
3075 for (i = 1; i < info->hdr->e_shnum; i++) { in elf_validity_check()
3076 shdr = &info->sechdrs[i]; in elf_validity_check()
3083 || shdr->sh_link >= info->hdr->e_shnum) in elf_validity_check()
3087 err = validate_section_offset(info, shdr); in elf_validity_check()
3126 static int check_modinfo_livepatch(struct module *mod, struct load_info *info) in check_modinfo_livepatch() argument
3128 if (get_modinfo(info, "livepatch")) { in check_modinfo_livepatch()
3138 static int check_modinfo_livepatch(struct module *mod, struct load_info *info) in check_modinfo_livepatch() argument
3140 if (get_modinfo(info, "livepatch")) { in check_modinfo_livepatch()
3150 static void check_modinfo_retpoline(struct module *mod, struct load_info *info) in check_modinfo_retpoline() argument
3152 if (retpoline_module_ok(get_modinfo(info, "retpoline"))) in check_modinfo_retpoline()
3161 struct load_info *info) in copy_module_from_user() argument
3165 info->len = len; in copy_module_from_user()
3166 if (info->len < sizeof(*(info->hdr))) in copy_module_from_user()
3174 info->hdr = __vmalloc(info->len, GFP_KERNEL | __GFP_NOWARN); in copy_module_from_user()
3175 if (!info->hdr) in copy_module_from_user()
3178 if (copy_chunked_from_user(info->hdr, umod, info->len) != 0) { in copy_module_from_user()
3183 err = security_kernel_post_load_data((char *)info->hdr, info->len, in copy_module_from_user()
3187 vfree(info->hdr); in copy_module_from_user()
3192 static void free_copy(struct load_info *info) in free_copy() argument
3194 vfree(info->hdr); in free_copy()
3197 static int rewrite_section_headers(struct load_info *info, int flags) in rewrite_section_headers() argument
3202 info->sechdrs[0].sh_addr = 0; in rewrite_section_headers()
3204 for (i = 1; i < info->hdr->e_shnum; i++) { in rewrite_section_headers()
3205 Elf_Shdr *shdr = &info->sechdrs[i]; in rewrite_section_headers()
3209 shdr->sh_addr = (size_t)info->hdr + shdr->sh_offset; in rewrite_section_headers()
3214 info->sechdrs[info->index.vers].sh_flags &= ~(unsigned long)SHF_ALLOC; in rewrite_section_headers()
3215 info->sechdrs[info->index.info].sh_flags &= ~(unsigned long)SHF_ALLOC; in rewrite_section_headers()
3228 static int setup_load_info(struct load_info *info, int flags) in setup_load_info() argument
3233 info->index.info = find_sec(info, ".modinfo"); in setup_load_info()
3234 if (info->index.info) in setup_load_info()
3235 info->name = get_modinfo(info, "name"); in setup_load_info()
3238 for (i = 1; i < info->hdr->e_shnum; i++) { in setup_load_info()
3239 if (info->sechdrs[i].sh_type == SHT_SYMTAB) { in setup_load_info()
3240 info->index.sym = i; in setup_load_info()
3241 info->index.str = info->sechdrs[i].sh_link; in setup_load_info()
3242 info->strtab = (char *)info->hdr in setup_load_info()
3243 + info->sechdrs[info->index.str].sh_offset; in setup_load_info()
3248 if (info->index.sym == 0) { in setup_load_info()
3250 info->name ?: "(missing .modinfo section or name field)"); in setup_load_info()
3254 info->index.mod = find_sec(info, ".gnu.linkonce.this_module"); in setup_load_info()
3255 if (!info->index.mod) { in setup_load_info()
3257 info->name ?: "(missing .modinfo section or name field)"); in setup_load_info()
3261 info->mod = (void *)info->hdr + info->sechdrs[info->index.mod].sh_offset; in setup_load_info()
3267 if (!info->name) in setup_load_info()
3268 info->name = info->mod->name; in setup_load_info()
3271 info->index.vers = 0; /* Pretend no __versions section! */ in setup_load_info()
3273 info->index.vers = find_sec(info, "__versions"); in setup_load_info()
3275 info->index.pcpu = find_pcpusec(info); in setup_load_info()
3280 static int check_modinfo(struct module *mod, struct load_info *info, int flags) in check_modinfo() argument
3282 const char *modmagic = get_modinfo(info, "vermagic"); in check_modinfo()
3293 } else if (!same_magic(modmagic, vermagic, info->index.vers)) { in check_modinfo()
3295 info->name, modmagic, vermagic); in check_modinfo()
3299 if (!get_modinfo(info, "intree")) { in check_modinfo()
3306 check_modinfo_retpoline(mod, info); in check_modinfo()
3308 if (get_modinfo(info, "staging")) { in check_modinfo()
3314 err = check_modinfo_livepatch(mod, info); in check_modinfo()
3319 set_license(mod, get_modinfo(info, "license")); in check_modinfo()
3324 static int find_module_sections(struct module *mod, struct load_info *info) in find_module_sections() argument
3326 mod->kp = section_objs(info, "__param", in find_module_sections()
3328 mod->syms = section_objs(info, "__ksymtab", in find_module_sections()
3330 mod->crcs = section_addr(info, "__kcrctab"); in find_module_sections()
3331 mod->gpl_syms = section_objs(info, "__ksymtab_gpl", in find_module_sections()
3334 mod->gpl_crcs = section_addr(info, "__kcrctab_gpl"); in find_module_sections()
3335 mod->gpl_future_syms = section_objs(info, in find_module_sections()
3339 mod->gpl_future_crcs = section_addr(info, "__kcrctab_gpl_future"); in find_module_sections()
3342 mod->unused_syms = section_objs(info, "__ksymtab_unused", in find_module_sections()
3345 mod->unused_crcs = section_addr(info, "__kcrctab_unused"); in find_module_sections()
3346 mod->unused_gpl_syms = section_objs(info, "__ksymtab_unused_gpl", in find_module_sections()
3349 mod->unused_gpl_crcs = section_addr(info, "__kcrctab_unused_gpl"); in find_module_sections()
3352 mod->ctors = section_objs(info, ".ctors", in find_module_sections()
3355 mod->ctors = section_objs(info, ".init_array", in find_module_sections()
3357 else if (find_sec(info, ".init_array")) { in find_module_sections()
3368 mod->noinstr_text_start = section_objs(info, ".noinstr.text", 1, in find_module_sections()
3372 mod->tracepoints_ptrs = section_objs(info, "__tracepoints_ptrs", in find_module_sections()
3377 mod->srcu_struct_ptrs = section_objs(info, "___srcu_struct_ptrs", in find_module_sections()
3382 mod->bpf_raw_events = section_objs(info, "__bpf_raw_tp_map", in find_module_sections()
3387 mod->jump_entries = section_objs(info, "__jump_table", in find_module_sections()
3392 mod->trace_events = section_objs(info, "_ftrace_events", in find_module_sections()
3395 mod->trace_evals = section_objs(info, "_ftrace_eval_map", in find_module_sections()
3400 mod->trace_bprintk_fmt_start = section_objs(info, "__trace_printk_fmt", in find_module_sections()
3406 mod->ftrace_callsites = section_objs(info, FTRACE_CALLSITE_SECTION, in find_module_sections()
3411 mod->ei_funcs = section_objs(info, "_error_injection_whitelist", in find_module_sections()
3416 mod->kprobes_text_start = section_objs(info, ".kprobes.text", 1, in find_module_sections()
3418 mod->kprobe_blacklist = section_objs(info, "_kprobe_blacklist", in find_module_sections()
3423 mod->static_call_sites = section_objs(info, ".static_call_sites", in find_module_sections()
3427 mod->extable = section_objs(info, "__ex_table", in find_module_sections()
3430 if (section_addr(info, "__obsparm")) in find_module_sections()
3433 info->debug = section_objs(info, "__dyndbg", in find_module_sections()
3434 sizeof(*info->debug), &info->num_debug); in find_module_sections()
3439 static int move_module(struct module *mod, struct load_info *info) in move_module() argument
3478 for (i = 0; i < info->hdr->e_shnum; i++) { in move_module()
3480 Elf_Shdr *shdr = &info->sechdrs[i]; in move_module()
3496 (long)shdr->sh_addr, info->secstrings + shdr->sh_name); in move_module()
3587 static struct module *layout_and_allocate(struct load_info *info, int flags) in layout_and_allocate() argument
3593 err = check_modinfo(info->mod, info, flags); in layout_and_allocate()
3598 err = module_frob_arch_sections(info->hdr, info->sechdrs, in layout_and_allocate()
3599 info->secstrings, info->mod); in layout_and_allocate()
3603 err = module_enforce_rwx_sections(info->hdr, info->sechdrs, in layout_and_allocate()
3604 info->secstrings, info->mod); in layout_and_allocate()
3609 info->sechdrs[info->index.pcpu].sh_flags &= ~(unsigned long)SHF_ALLOC; in layout_and_allocate()
3616 ndx = find_sec(info, ".data..ro_after_init"); in layout_and_allocate()
3618 info->sechdrs[ndx].sh_flags |= SHF_RO_AFTER_INIT; in layout_and_allocate()
3625 ndx = find_sec(info, "__jump_table"); in layout_and_allocate()
3627 info->sechdrs[ndx].sh_flags |= SHF_RO_AFTER_INIT; in layout_and_allocate()
3632 layout_sections(info->mod, info); in layout_and_allocate()
3633 layout_symtab(info->mod, info); in layout_and_allocate()
3636 err = move_module(info->mod, info); in layout_and_allocate()
3641 mod = (void *)info->sechdrs[info->index.mod].sh_addr; in layout_and_allocate()
3642 kmemleak_load_module(mod, info); in layout_and_allocate()
3647 static void module_deallocate(struct module *mod, struct load_info *info) in module_deallocate() argument
3670 static int post_relocation(struct module *mod, const struct load_info *info) in post_relocation() argument
3676 percpu_modcopy(mod, (void *)info->sechdrs[info->index.pcpu].sh_addr, in post_relocation()
3677 info->sechdrs[info->index.pcpu].sh_size); in post_relocation()
3680 add_kallsyms(mod, info); in post_relocation()
3683 return module_finalize(info->hdr, info->sechdrs, mod); in post_relocation()
3914 static int complete_formation(struct module *mod, struct load_info *info) in complete_formation() argument
3926 module_bug_finalize(info->hdr, info->sechdrs, mod); in complete_formation()
3985 static int load_module(struct load_info *info, const char __user *uargs, in load_module() argument
4004 err = module_sig_check(info, flags); in load_module()
4012 err = elf_validity_check(info); in load_module()
4022 err = setup_load_info(info, flags); in load_module()
4030 if (blacklisted(info->name)) { in load_module()
4032 pr_err("Module %s is blacklisted\n", info->name); in load_module()
4036 err = rewrite_section_headers(info, flags); in load_module()
4041 if (!check_modstruct_version(info, info->mod)) { in load_module()
4047 mod = layout_and_allocate(info, flags); in load_module()
4061 mod->sig_ok = info->sig_ok; in load_module()
4071 err = percpu_modalloc(mod, info); in load_module()
4084 err = find_module_sections(mod, info); in load_module()
4093 setup_modinfo(mod, info); in load_module()
4096 err = simplify_symbols(mod, info); in load_module()
4100 err = apply_relocations(mod, info); in load_module()
4104 err = post_relocation(mod, info); in load_module()
4120 dynamic_debug_setup(mod, info->debug, info->num_debug); in load_module()
4126 err = complete_formation(mod, info); in load_module()
4147 err = mod_sysfs_setup(mod, info, mod->kp, mod->num_kp); in load_module()
4152 err = copy_module_elf(mod, info); in load_module()
4158 free_copy(info); in load_module()
4182 dynamic_debug_remove(mod, info->debug); in load_module()
4205 module_deallocate(mod, info); in load_module()
4207 free_copy(info); in load_module()
4215 struct load_info info = { }; in SYSCALL_DEFINE3() local
4224 err = copy_module_from_user(umod, len, &info); in SYSCALL_DEFINE3()
4228 return load_module(&info, uargs, 0); in SYSCALL_DEFINE3()
4233 struct load_info info = { }; in SYSCALL_DEFINE3() local
4251 info.hdr = hdr; in SYSCALL_DEFINE3()
4252 info.len = err; in SYSCALL_DEFINE3()
4254 return load_module(&info, uargs, flags); in SYSCALL_DEFINE3()