/kernel/module/ |
D | main.c | 115 static void mod_update_bounds(struct module *mod) in mod_update_bounds() argument 117 __mod_update_bounds(mod->core_layout.base, mod->core_layout.size, &mod_tree); in mod_update_bounds() 118 if (mod->init_layout.size) in mod_update_bounds() 119 __mod_update_bounds(mod->init_layout.base, mod->init_layout.size, &mod_tree); in mod_update_bounds() 121 __mod_update_bounds(mod->data_layout.base, mod->data_layout.size, &mod_data_tree); in mod_update_bounds() 151 static inline int strong_try_module_get(struct module *mod) in strong_try_module_get() argument 153 BUG_ON(mod && mod->state == MODULE_STATE_UNFORMED); in strong_try_module_get() 154 if (mod && mod->state == MODULE_STATE_COMING) in strong_try_module_get() 156 if (try_module_get(mod)) in strong_try_module_get() 162 static inline void add_taint_module(struct module *mod, unsigned flag, in add_taint_module() argument [all …]
|
D | sysfs.c | 72 static void add_sect_attrs(struct module *mod, const struct load_info *info) in add_sect_attrs() argument 116 if (sysfs_create_group(&mod->mkobj.kobj, §_attrs->grp)) in add_sect_attrs() 119 mod->sect_attrs = sect_attrs; in add_sect_attrs() 125 static void remove_sect_attrs(struct module *mod) in remove_sect_attrs() argument 127 if (mod->sect_attrs) { in remove_sect_attrs() 128 sysfs_remove_group(&mod->mkobj.kobj, in remove_sect_attrs() 129 &mod->sect_attrs->grp); in remove_sect_attrs() 134 free_sect_attrs(mod->sect_attrs); in remove_sect_attrs() 135 mod->sect_attrs = NULL; in remove_sect_attrs() 172 static void add_notes_attrs(struct module *mod, const struct load_info *info) in add_notes_attrs() argument [all …]
|
D | kallsyms.c | 24 const struct module *mod) in is_exported() argument 28 if (!mod) in is_exported() 31 ks = lookup_exported_symbol(name, mod->syms, mod->syms + mod->num_syms); in is_exported() 110 void layout_symtab(struct module *mod, struct load_info *info) in layout_symtab() argument 119 symsect->sh_entsize = module_get_offset(mod, &mod->init_layout.size, symsect, in layout_symtab() 128 if (i == 0 || is_livepatch_module(mod) || in layout_symtab() 137 info->symoffs = ALIGN(mod->data_layout.size, symsect->sh_addralign ?: 1); in layout_symtab() 138 info->stroffs = mod->data_layout.size = info->symoffs + ndst * sizeof(Elf_Sym); in layout_symtab() 139 mod->data_layout.size += strtab_size; in layout_symtab() 141 info->core_typeoffs = mod->data_layout.size; in layout_symtab() [all …]
|
D | internal.h | 60 struct module *mod; member 77 unsigned int sym, str, mod, vers, info, pcpu; member 99 int mod_verify_sig(const void *mod, struct load_info *info); 100 int try_to_force_load(struct module *mod, const char *reason); 104 long module_get_offset(struct module *mod, unsigned int *size, Elf_Shdr *sechdr, 106 char *module_flags(struct module *mod, char *buf, bool show_state); 130 int copy_module_elf(struct module *mod, struct load_info *info); 131 void free_module_elf(struct module *mod); 133 static inline int copy_module_elf(struct module *mod, struct load_info *info) in copy_module_elf() argument 138 static inline void free_module_elf(struct module *mod) { } in free_module_elf() argument [all …]
|
D | strict_rwx.c | 72 bool module_check_misalignment(const struct module *mod) in module_check_misalignment() argument 77 return layout_check_misalignment(&mod->core_layout) || in module_check_misalignment() 78 layout_check_misalignment(&mod->data_layout) || in module_check_misalignment() 79 layout_check_misalignment(&mod->init_layout); in module_check_misalignment() 82 void module_enable_x(const struct module *mod) in module_enable_x() argument 84 if (!PAGE_ALIGNED(mod->core_layout.base) || in module_enable_x() 85 !PAGE_ALIGNED(mod->init_layout.base)) in module_enable_x() 88 frob_text(&mod->core_layout, set_memory_x); in module_enable_x() 89 frob_text(&mod->init_layout, set_memory_x); in module_enable_x() 92 void module_enable_ro(const struct module *mod, bool after_init) in module_enable_ro() argument [all …]
|
D | tree_lookup.c | 78 void mod_tree_insert(struct module *mod) in mod_tree_insert() argument 80 mod->core_layout.mtn.mod = mod; in mod_tree_insert() 81 mod->init_layout.mtn.mod = mod; in mod_tree_insert() 83 __mod_tree_insert(&mod->core_layout.mtn, &mod_tree); in mod_tree_insert() 84 if (mod->init_layout.size) in mod_tree_insert() 85 __mod_tree_insert(&mod->init_layout.mtn, &mod_tree); in mod_tree_insert() 88 mod->data_layout.mtn.mod = mod; in mod_tree_insert() 89 __mod_tree_insert(&mod->data_layout.mtn, &mod_data_tree); in mod_tree_insert() 93 void mod_tree_remove_init(struct module *mod) in mod_tree_remove_init() argument 95 if (mod->init_layout.size) in mod_tree_remove_init() [all …]
|
D | livepatch.c | 18 int copy_module_elf(struct module *mod, struct load_info *info) in copy_module_elf() argument 23 size = sizeof(*mod->klp_info); in copy_module_elf() 24 mod->klp_info = kmalloc(size, GFP_KERNEL); in copy_module_elf() 25 if (!mod->klp_info) in copy_module_elf() 29 size = sizeof(mod->klp_info->hdr); in copy_module_elf() 30 memcpy(&mod->klp_info->hdr, info->hdr, size); in copy_module_elf() 34 mod->klp_info->sechdrs = kmemdup(info->sechdrs, size, GFP_KERNEL); in copy_module_elf() 35 if (!mod->klp_info->sechdrs) { in copy_module_elf() 42 mod->klp_info->secstrings = kmemdup(info->secstrings, size, GFP_KERNEL); in copy_module_elf() 43 if (!mod->klp_info->secstrings) { in copy_module_elf() [all …]
|
D | procfs.c | 16 static inline void print_unload_info(struct seq_file *m, struct module *mod) in print_unload_info() argument 21 seq_printf(m, " %i ", module_refcount(mod)); in print_unload_info() 27 list_for_each_entry(use, &mod->source_list, source_list) { in print_unload_info() 32 if (mod->init && !mod->exit) { in print_unload_info() 41 static inline void print_unload_info(struct seq_file *m, struct module *mod) in print_unload_info() argument 67 struct module *mod = list_entry(p, struct module, list); in m_show() local 73 if (mod->state == MODULE_STATE_UNFORMED) in m_show() 76 size = mod->init_layout.size + mod->core_layout.size; in m_show() 78 size += mod->data_layout.size; in m_show() 80 seq_printf(m, "%s %u", mod->name, size); in m_show() [all …]
|
D | kdb.c | 19 struct module *mod; in kdb_lsmod() local 25 list_for_each_entry(mod, &modules, list) { in kdb_lsmod() 26 if (mod->state == MODULE_STATE_UNFORMED) in kdb_lsmod() 29 kdb_printf("%-20s%8u", mod->name, mod->core_layout.size); in kdb_lsmod() 31 kdb_printf("/%8u", mod->data_layout.size); in kdb_lsmod() 33 kdb_printf(" 0x%px ", (void *)mod); in kdb_lsmod() 35 kdb_printf("%4d ", module_refcount(mod)); in kdb_lsmod() 37 if (mod->state == MODULE_STATE_GOING) in kdb_lsmod() 39 else if (mod->state == MODULE_STATE_COMING) in kdb_lsmod() 43 kdb_printf(" 0x%px", mod->core_layout.base); in kdb_lsmod() [all …]
|
D | signing.c | 50 int mod_verify_sig(const void *mod, struct load_info *info) in mod_verify_sig() argument 61 memcpy(&ms, mod + (modlen - sizeof(ms)), sizeof(ms)); in mod_verify_sig() 71 return verify_pkcs7_signature(mod, modlen, mod + modlen, sig_len, in mod_verify_sig() 82 const void *mod = info->hdr; in module_sig_check() local 91 memcmp(mod + info->len - markerlen, MODULE_SIG_STRING, markerlen) == 0) { in module_sig_check() 94 err = mod_verify_sig(mod, info); in module_sig_check()
|
D | tracking.c | 19 int try_add_tainted_module(struct module *mod) in try_add_tainted_module() argument 25 if (!mod->taints) in try_add_tainted_module() 30 if (!strcmp(mod_taint->name, mod->name) && in try_add_tainted_module() 31 mod_taint->taints & mod->taints) { in try_add_tainted_module() 40 strscpy(mod_taint->name, mod->name, MODULE_NAME_LEN); in try_add_tainted_module() 41 mod_taint->taints = mod->taints; in try_add_tainted_module()
|
D | version.c | 15 struct module *mod, in check_version() argument 29 return try_to_force_load(mod, symname) == 0; in check_version() 59 struct module *mod) in check_modstruct_version() argument 76 return check_version(info, "module_layout", mod, fsa.crc); in check_modstruct_version() 94 void module_layout(struct module *mod, in module_layout() argument
|
D | debug_kmemleak.c | 12 void kmemleak_load_module(const struct module *mod, in kmemleak_load_module() argument 18 kmemleak_scan_area(mod, sizeof(struct module), GFP_KERNEL); in kmemleak_load_module()
|
/kernel/ |
D | static_call_inline.c | 147 .mod = NULL, in __static_call_update() 153 struct module *mod = site_mod->mod; in __static_call_update() local 168 if (mod) { in __static_call_update() 170 stop = mod->static_call_sites + in __static_call_update() 171 mod->num_static_call_sites; in __static_call_update() 172 init = mod->state == MODULE_STATE_COMING; in __static_call_update() 209 static int __static_call_init(struct module *mod, in __static_call_init() argument 225 if ((mod && within_module_init((unsigned long)site_addr, mod)) || in __static_call_init() 226 (!mod && init_section_contains(site_addr, 1))) in __static_call_init() 241 if (!mod) { in __static_call_init() [all …]
|
D | jump_label.c | 520 struct module *mod; member 536 struct static_key_mod *mod) in static_key_set_mod() argument 540 WARN_ON_ONCE((unsigned long)mod & JUMP_TYPE_MASK); in static_key_set_mod() 542 key->next = mod; in static_key_set_mod() 548 struct module *mod; in __jump_label_mod_text_reserved() local 552 mod = __module_text_address((unsigned long)start); in __jump_label_mod_text_reserved() 553 WARN_ON_ONCE(__module_text_address((unsigned long)end) != mod); in __jump_label_mod_text_reserved() 554 if (!try_module_get(mod)) in __jump_label_mod_text_reserved() 555 mod = NULL; in __jump_label_mod_text_reserved() 558 if (!mod) in __jump_label_mod_text_reserved() [all …]
|
D | cfi.c | 49 struct module *mod) in module_cfi_finalize() argument 54 mod->kcfi_traps = NULL; in module_cfi_finalize() 55 mod->kcfi_traps_end = NULL; in module_cfi_finalize() 63 mod->kcfi_traps = (s32 *)sechdrs[i].sh_addr; in module_cfi_finalize() 64 mod->kcfi_traps_end = (s32 *)(sechdrs[i].sh_addr + sechdrs[i].sh_size); in module_cfi_finalize() 71 struct module *mod; in is_module_cfi_trap() local 76 mod = __module_address(addr); in is_module_cfi_trap() 77 if (mod) in is_module_cfi_trap() 78 found = is_trap(addr, mod->kcfi_traps, mod->kcfi_traps_end); in is_module_cfi_trap()
|
D | params.c | 23 #define KPARAM_MUTEX(mod) ((mod) ? &(mod)->param_lock : ¶m_lock) argument 25 #define KPARAM_MUTEX(mod) (¶m_lock) argument 28 static inline void check_kparam_locked(struct module *mod) in check_kparam_locked() argument 30 BUG_ON(!mutex_is_locked(KPARAM_MUTEX(mod))); in check_kparam_locked() 33 static inline void check_kparam_locked(struct module *mod) in check_kparam_locked() argument 141 kernel_param_lock(params[i].mod); in parse_one() 146 kernel_param_unlock(params[i].mod); in parse_one() 413 static int param_array(struct module *mod, in param_array() argument 445 check_kparam_locked(mod); in param_array() 467 return param_array(kp->mod, kp->name, val, 1, arr->max, arr->elem, in param_array_set() [all …]
|
D | tracepoint.c | 571 bool trace_module_has_bad_taint(struct module *mod) in trace_module_has_bad_taint() argument 573 return mod->taints & ~((1 << TAINT_OOT_MODULE) | (1 << TAINT_CRAP) | in trace_module_has_bad_taint() 640 static int tracepoint_module_coming(struct module *mod) in tracepoint_module_coming() argument 644 if (!mod->num_tracepoints) in tracepoint_module_coming() 652 if (trace_module_has_bad_taint(mod)) in tracepoint_module_coming() 658 tp_mod->mod = mod; in tracepoint_module_coming() 668 static void tracepoint_module_going(struct module *mod) in tracepoint_module_going() argument 672 if (!mod->num_tracepoints) in tracepoint_module_going() 677 if (tp_mod->mod == mod) { in tracepoint_module_going() 686 for_each_tracepoint_range(mod->tracepoints_ptrs, in tracepoint_module_going() [all …]
|
D | kprobes.c | 2581 static void add_module_kprobe_blacklist(struct module *mod) in add_module_kprobe_blacklist() argument 2586 if (mod->kprobe_blacklist) { in add_module_kprobe_blacklist() 2587 for (i = 0; i < mod->num_kprobe_blacklist; i++) in add_module_kprobe_blacklist() 2588 kprobe_add_ksym_blacklist(mod->kprobe_blacklist[i]); in add_module_kprobe_blacklist() 2591 start = (unsigned long)mod->kprobes_text_start; in add_module_kprobe_blacklist() 2593 end = start + mod->kprobes_text_size; in add_module_kprobe_blacklist() 2597 start = (unsigned long)mod->noinstr_text_start; in add_module_kprobe_blacklist() 2599 end = start + mod->noinstr_text_size; in add_module_kprobe_blacklist() 2604 static void remove_module_kprobe_blacklist(struct module *mod) in remove_module_kprobe_blacklist() argument 2609 if (mod->kprobe_blacklist) { in remove_module_kprobe_blacklist() [all …]
|
/kernel/printk/ |
D | index.c | 20 static struct pi_entry *pi_get_entry(const struct module *mod, loff_t pos) in pi_get_entry() argument 26 if (mod) { in pi_get_entry() 27 entries = mod->printk_index_start; in pi_get_entry() 28 nr_entries = mod->printk_index_size; in pi_get_entry() 45 const struct module *mod = s->file->f_inode->i_private; in pi_next() local 46 struct pi_entry *entry = pi_get_entry(mod, *pos); in pi_next() 128 static const char *pi_get_module_name(struct module *mod) in pi_get_module_name() argument 130 return mod ? mod->name : "vmlinux"; in pi_get_module_name() 133 static const char *pi_get_module_name(struct module *mod) in pi_get_module_name() argument 139 static void pi_create_file(struct module *mod) in pi_create_file() argument [all …]
|
/kernel/livepatch/ |
D | core.c | 56 struct module *mod; in klp_find_object_module() local 67 mod = find_module(obj->name); in klp_find_object_module() 75 if (mod && mod->klp_alive) in klp_find_object_module() 76 obj->mod = mod; in klp_find_object_module() 129 struct module *mod, unsigned long addr) in klp_find_callback() argument 133 if ((mod && !args->objname) || (!mod && args->objname)) in klp_find_callback() 139 if (args->objname && strcmp(args->objname, mod->name)) in klp_find_callback() 632 obj->mod = NULL; in klp_free_object_loaded() 703 module_put(patch->mod); in klp_free_patch_finish() 769 struct klp_modinfo *info = patch->mod->klp_info; in klp_apply_object_relocs() [all …]
|
D | transition.c | 76 klp_transition_patch->mod->name, in klp_complete_transition() 130 pr_notice("'%s': %s complete\n", klp_transition_patch->mod->name, in klp_complete_transition() 149 klp_transition_patch->mod->name); in klp_cancel_transition() 470 klp_transition_patch->mod->name, in klp_start_transition() 521 pr_debug("'%s': initializing %s transition\n", patch->mod->name, in klp_init_transition() 583 klp_transition_patch->mod->name, in klp_reverse_transition()
|
/kernel/trace/ |
D | trace_printk.c | 91 struct module *mod = data; in module_trace_bprintk_format_notify() local 92 if (mod->num_trace_bprintk_fmt) { in module_trace_bprintk_format_notify() 93 const char **start = mod->trace_bprintk_fmt_start; in module_trace_bprintk_format_notify() 94 const char **end = start + mod->num_trace_bprintk_fmt; in module_trace_bprintk_format_notify()
|
D | ftrace.c | 2740 ftrace_nop_initialize(struct module *mod, struct dyn_ftrace *rec) in ftrace_nop_initialize() argument 2747 ret = ftrace_init_nop(mod, rec); in ftrace_nop_initialize() 3125 static int ftrace_update_code(struct module *mod, struct ftrace_page *new_pgs) in ftrace_update_code() argument 3148 if (mod) in ftrace_update_code() 3166 if (init_nop && !ftrace_nop_initialize(mod, p)) in ftrace_update_code() 4161 match_records(struct ftrace_hash *hash, char *func, int len, char *mod) in match_records() argument 4167 struct ftrace_glob *mod_match = (mod) ? &mod_g : NULL; in match_records() 4179 if (mod) { in match_records() 4180 mod_g.type = filter_parse_regex(mod, strlen(mod), in match_records() 4339 char *mod, bool enable) in process_mod_list() argument [all …]
|
/kernel/gcov/ |
D | base.c | 106 struct module *mod = data; in gcov_module_notifier() local 116 if (gcov_info_within_module(info, mod)) { in gcov_module_notifier()
|