diff options
Diffstat (limited to 'kernel/module.c')
| -rw-r--r-- | kernel/module.c | 117 |
1 files changed, 62 insertions, 55 deletions
diff --git a/kernel/module.c b/kernel/module.c index 1f4cc00e0c20..e8b51d41dd72 100644 --- a/kernel/module.c +++ b/kernel/module.c | |||
| @@ -43,7 +43,6 @@ | |||
| 43 | #include <linux/device.h> | 43 | #include <linux/device.h> |
| 44 | #include <linux/string.h> | 44 | #include <linux/string.h> |
| 45 | #include <linux/mutex.h> | 45 | #include <linux/mutex.h> |
| 46 | #include <linux/unwind.h> | ||
| 47 | #include <linux/rculist.h> | 46 | #include <linux/rculist.h> |
| 48 | #include <asm/uaccess.h> | 47 | #include <asm/uaccess.h> |
| 49 | #include <asm/cacheflush.h> | 48 | #include <asm/cacheflush.h> |
| @@ -51,6 +50,7 @@ | |||
| 51 | #include <asm/sections.h> | 50 | #include <asm/sections.h> |
| 52 | #include <linux/tracepoint.h> | 51 | #include <linux/tracepoint.h> |
| 53 | #include <linux/ftrace.h> | 52 | #include <linux/ftrace.h> |
| 53 | #include <linux/async.h> | ||
| 54 | 54 | ||
| 55 | #if 0 | 55 | #if 0 |
| 56 | #define DEBUGP printk | 56 | #define DEBUGP printk |
| @@ -743,8 +743,8 @@ static void wait_for_zero_refcount(struct module *mod) | |||
| 743 | mutex_lock(&module_mutex); | 743 | mutex_lock(&module_mutex); |
| 744 | } | 744 | } |
| 745 | 745 | ||
| 746 | asmlinkage long | 746 | SYSCALL_DEFINE2(delete_module, const char __user *, name_user, |
| 747 | sys_delete_module(const char __user *name_user, unsigned int flags) | 747 | unsigned int, flags) |
| 748 | { | 748 | { |
| 749 | struct module *mod; | 749 | struct module *mod; |
| 750 | char name[MODULE_NAME_LEN]; | 750 | char name[MODULE_NAME_LEN]; |
| @@ -757,8 +757,16 @@ sys_delete_module(const char __user *name_user, unsigned int flags) | |||
| 757 | return -EFAULT; | 757 | return -EFAULT; |
| 758 | name[MODULE_NAME_LEN-1] = '\0'; | 758 | name[MODULE_NAME_LEN-1] = '\0'; |
| 759 | 759 | ||
| 760 | if (mutex_lock_interruptible(&module_mutex) != 0) | 760 | /* Create stop_machine threads since free_module relies on |
| 761 | return -EINTR; | 761 | * a non-failing stop_machine call. */ |
| 762 | ret = stop_machine_create(); | ||
| 763 | if (ret) | ||
| 764 | return ret; | ||
| 765 | |||
| 766 | if (mutex_lock_interruptible(&module_mutex) != 0) { | ||
| 767 | ret = -EINTR; | ||
| 768 | goto out_stop; | ||
| 769 | } | ||
| 762 | 770 | ||
| 763 | mod = find_module(name); | 771 | mod = find_module(name); |
| 764 | if (!mod) { | 772 | if (!mod) { |
| @@ -809,6 +817,7 @@ sys_delete_module(const char __user *name_user, unsigned int flags) | |||
| 809 | mod->exit(); | 817 | mod->exit(); |
| 810 | blocking_notifier_call_chain(&module_notify_list, | 818 | blocking_notifier_call_chain(&module_notify_list, |
| 811 | MODULE_STATE_GOING, mod); | 819 | MODULE_STATE_GOING, mod); |
| 820 | async_synchronize_full(); | ||
| 812 | mutex_lock(&module_mutex); | 821 | mutex_lock(&module_mutex); |
| 813 | /* Store the name of the last unloaded module for diagnostic purposes */ | 822 | /* Store the name of the last unloaded module for diagnostic purposes */ |
| 814 | strlcpy(last_unloaded_module, mod->name, sizeof(last_unloaded_module)); | 823 | strlcpy(last_unloaded_module, mod->name, sizeof(last_unloaded_module)); |
| @@ -817,10 +826,12 @@ sys_delete_module(const char __user *name_user, unsigned int flags) | |||
| 817 | 826 | ||
| 818 | out: | 827 | out: |
| 819 | mutex_unlock(&module_mutex); | 828 | mutex_unlock(&module_mutex); |
| 829 | out_stop: | ||
| 830 | stop_machine_destroy(); | ||
| 820 | return ret; | 831 | return ret; |
| 821 | } | 832 | } |
| 822 | 833 | ||
| 823 | static void print_unload_info(struct seq_file *m, struct module *mod) | 834 | static inline void print_unload_info(struct seq_file *m, struct module *mod) |
| 824 | { | 835 | { |
| 825 | struct module_use *use; | 836 | struct module_use *use; |
| 826 | int printed_something = 0; | 837 | int printed_something = 0; |
| @@ -893,7 +904,7 @@ void module_put(struct module *module) | |||
| 893 | EXPORT_SYMBOL(module_put); | 904 | EXPORT_SYMBOL(module_put); |
| 894 | 905 | ||
| 895 | #else /* !CONFIG_MODULE_UNLOAD */ | 906 | #else /* !CONFIG_MODULE_UNLOAD */ |
| 896 | static void print_unload_info(struct seq_file *m, struct module *mod) | 907 | static inline void print_unload_info(struct seq_file *m, struct module *mod) |
| 897 | { | 908 | { |
| 898 | /* We don't know the usage count, or what modules are using. */ | 909 | /* We don't know the usage count, or what modules are using. */ |
| 899 | seq_printf(m, " - -"); | 910 | seq_printf(m, " - -"); |
| @@ -1439,8 +1450,6 @@ static void free_module(struct module *mod) | |||
| 1439 | remove_sect_attrs(mod); | 1450 | remove_sect_attrs(mod); |
| 1440 | mod_kobject_remove(mod); | 1451 | mod_kobject_remove(mod); |
| 1441 | 1452 | ||
| 1442 | unwind_remove_table(mod->unwind_info, 0); | ||
| 1443 | |||
| 1444 | /* Arch-specific cleanup. */ | 1453 | /* Arch-specific cleanup. */ |
| 1445 | module_arch_cleanup(mod); | 1454 | module_arch_cleanup(mod); |
| 1446 | 1455 | ||
| @@ -1578,11 +1587,21 @@ static int simplify_symbols(Elf_Shdr *sechdrs, | |||
| 1578 | return ret; | 1587 | return ret; |
| 1579 | } | 1588 | } |
| 1580 | 1589 | ||
| 1590 | /* Additional bytes needed by arch in front of individual sections */ | ||
| 1591 | unsigned int __weak arch_mod_section_prepend(struct module *mod, | ||
| 1592 | unsigned int section) | ||
| 1593 | { | ||
| 1594 | /* default implementation just returns zero */ | ||
| 1595 | return 0; | ||
| 1596 | } | ||
| 1597 | |||
| 1581 | /* Update size with this section: return offset. */ | 1598 | /* Update size with this section: return offset. */ |
| 1582 | static long get_offset(unsigned int *size, Elf_Shdr *sechdr) | 1599 | static long get_offset(struct module *mod, unsigned int *size, |
| 1600 | Elf_Shdr *sechdr, unsigned int section) | ||
| 1583 | { | 1601 | { |
| 1584 | long ret; | 1602 | long ret; |
| 1585 | 1603 | ||
| 1604 | *size += arch_mod_section_prepend(mod, section); | ||
| 1586 | ret = ALIGN(*size, sechdr->sh_addralign ?: 1); | 1605 | ret = ALIGN(*size, sechdr->sh_addralign ?: 1); |
| 1587 | *size = ret + sechdr->sh_size; | 1606 | *size = ret + sechdr->sh_size; |
| 1588 | return ret; | 1607 | return ret; |
| @@ -1622,7 +1641,7 @@ static void layout_sections(struct module *mod, | |||
| 1622 | || strncmp(secstrings + s->sh_name, | 1641 | || strncmp(secstrings + s->sh_name, |
| 1623 | ".init", 5) == 0) | 1642 | ".init", 5) == 0) |
| 1624 | continue; | 1643 | continue; |
| 1625 | s->sh_entsize = get_offset(&mod->core_size, s); | 1644 | s->sh_entsize = get_offset(mod, &mod->core_size, s, i); |
| 1626 | DEBUGP("\t%s\n", secstrings + s->sh_name); | 1645 | DEBUGP("\t%s\n", secstrings + s->sh_name); |
| 1627 | } | 1646 | } |
| 1628 | if (m == 0) | 1647 | if (m == 0) |
| @@ -1640,7 +1659,7 @@ static void layout_sections(struct module *mod, | |||
| 1640 | || strncmp(secstrings + s->sh_name, | 1659 | || strncmp(secstrings + s->sh_name, |
| 1641 | ".init", 5) != 0) | 1660 | ".init", 5) != 0) |
| 1642 | continue; | 1661 | continue; |
| 1643 | s->sh_entsize = (get_offset(&mod->init_size, s) | 1662 | s->sh_entsize = (get_offset(mod, &mod->init_size, s, i) |
| 1644 | | INIT_OFFSET_MASK); | 1663 | | INIT_OFFSET_MASK); |
| 1645 | DEBUGP("\t%s\n", secstrings + s->sh_name); | 1664 | DEBUGP("\t%s\n", secstrings + s->sh_name); |
| 1646 | } | 1665 | } |
| @@ -1725,15 +1744,15 @@ static const struct kernel_symbol *lookup_symbol(const char *name, | |||
| 1725 | return NULL; | 1744 | return NULL; |
| 1726 | } | 1745 | } |
| 1727 | 1746 | ||
| 1728 | static int is_exported(const char *name, const struct module *mod) | 1747 | static int is_exported(const char *name, unsigned long value, |
| 1748 | const struct module *mod) | ||
| 1729 | { | 1749 | { |
| 1730 | if (!mod && lookup_symbol(name, __start___ksymtab, __stop___ksymtab)) | 1750 | const struct kernel_symbol *ks; |
| 1731 | return 1; | 1751 | if (!mod) |
| 1752 | ks = lookup_symbol(name, __start___ksymtab, __stop___ksymtab); | ||
| 1732 | else | 1753 | else |
| 1733 | if (mod && lookup_symbol(name, mod->syms, mod->syms + mod->num_syms)) | 1754 | ks = lookup_symbol(name, mod->syms, mod->syms + mod->num_syms); |
| 1734 | return 1; | 1755 | return ks != NULL && ks->value == value; |
| 1735 | else | ||
| 1736 | return 0; | ||
| 1737 | } | 1756 | } |
| 1738 | 1757 | ||
| 1739 | /* As per nm */ | 1758 | /* As per nm */ |
| @@ -1847,7 +1866,6 @@ static noinline struct module *load_module(void __user *umod, | |||
| 1847 | unsigned int symindex = 0; | 1866 | unsigned int symindex = 0; |
| 1848 | unsigned int strindex = 0; | 1867 | unsigned int strindex = 0; |
| 1849 | unsigned int modindex, versindex, infoindex, pcpuindex; | 1868 | unsigned int modindex, versindex, infoindex, pcpuindex; |
| 1850 | unsigned int unwindex = 0; | ||
| 1851 | unsigned int num_kp, num_mcount; | 1869 | unsigned int num_kp, num_mcount; |
| 1852 | struct kernel_param *kp; | 1870 | struct kernel_param *kp; |
| 1853 | struct module *mod; | 1871 | struct module *mod; |
| @@ -1865,6 +1883,13 @@ static noinline struct module *load_module(void __user *umod, | |||
| 1865 | /* vmalloc barfs on "unusual" numbers. Check here */ | 1883 | /* vmalloc barfs on "unusual" numbers. Check here */ |
| 1866 | if (len > 64 * 1024 * 1024 || (hdr = vmalloc(len)) == NULL) | 1884 | if (len > 64 * 1024 * 1024 || (hdr = vmalloc(len)) == NULL) |
| 1867 | return ERR_PTR(-ENOMEM); | 1885 | return ERR_PTR(-ENOMEM); |
| 1886 | |||
| 1887 | /* Create stop_machine threads since the error path relies on | ||
| 1888 | * a non-failing stop_machine call. */ | ||
| 1889 | err = stop_machine_create(); | ||
| 1890 | if (err) | ||
| 1891 | goto free_hdr; | ||
| 1892 | |||
| 1868 | if (copy_from_user(hdr, umod, len) != 0) { | 1893 | if (copy_from_user(hdr, umod, len) != 0) { |
| 1869 | err = -EFAULT; | 1894 | err = -EFAULT; |
| 1870 | goto free_hdr; | 1895 | goto free_hdr; |
| @@ -1930,9 +1955,6 @@ static noinline struct module *load_module(void __user *umod, | |||
| 1930 | versindex = find_sec(hdr, sechdrs, secstrings, "__versions"); | 1955 | versindex = find_sec(hdr, sechdrs, secstrings, "__versions"); |
| 1931 | infoindex = find_sec(hdr, sechdrs, secstrings, ".modinfo"); | 1956 | infoindex = find_sec(hdr, sechdrs, secstrings, ".modinfo"); |
| 1932 | pcpuindex = find_pcpusec(hdr, sechdrs, secstrings); | 1957 | pcpuindex = find_pcpusec(hdr, sechdrs, secstrings); |
| 1933 | #ifdef ARCH_UNWIND_SECTION_NAME | ||
| 1934 | unwindex = find_sec(hdr, sechdrs, secstrings, ARCH_UNWIND_SECTION_NAME); | ||
| 1935 | #endif | ||
| 1936 | 1958 | ||
| 1937 | /* Don't keep modinfo and version sections. */ | 1959 | /* Don't keep modinfo and version sections. */ |
| 1938 | sechdrs[infoindex].sh_flags &= ~(unsigned long)SHF_ALLOC; | 1960 | sechdrs[infoindex].sh_flags &= ~(unsigned long)SHF_ALLOC; |
| @@ -1942,8 +1964,6 @@ static noinline struct module *load_module(void __user *umod, | |||
| 1942 | sechdrs[symindex].sh_flags |= SHF_ALLOC; | 1964 | sechdrs[symindex].sh_flags |= SHF_ALLOC; |
| 1943 | sechdrs[strindex].sh_flags |= SHF_ALLOC; | 1965 | sechdrs[strindex].sh_flags |= SHF_ALLOC; |
| 1944 | #endif | 1966 | #endif |
| 1945 | if (unwindex) | ||
| 1946 | sechdrs[unwindex].sh_flags |= SHF_ALLOC; | ||
| 1947 | 1967 | ||
| 1948 | /* Check module struct version now, before we try to use module. */ | 1968 | /* Check module struct version now, before we try to use module. */ |
| 1949 | if (!check_modstruct_version(sechdrs, versindex, mod)) { | 1969 | if (!check_modstruct_version(sechdrs, versindex, mod)) { |
| @@ -2184,24 +2204,15 @@ static noinline struct module *load_module(void __user *umod, | |||
| 2184 | struct mod_debug *debug; | 2204 | struct mod_debug *debug; |
| 2185 | unsigned int num_debug; | 2205 | unsigned int num_debug; |
| 2186 | 2206 | ||
| 2187 | #ifdef CONFIG_MARKERS | ||
| 2188 | marker_update_probe_range(mod->markers, | ||
| 2189 | mod->markers + mod->num_markers); | ||
| 2190 | #endif | ||
| 2191 | debug = section_objs(hdr, sechdrs, secstrings, "__verbose", | 2207 | debug = section_objs(hdr, sechdrs, secstrings, "__verbose", |
| 2192 | sizeof(*debug), &num_debug); | 2208 | sizeof(*debug), &num_debug); |
| 2193 | dynamic_printk_setup(debug, num_debug); | 2209 | dynamic_printk_setup(debug, num_debug); |
| 2194 | |||
| 2195 | #ifdef CONFIG_TRACEPOINTS | ||
| 2196 | tracepoint_update_probe_range(mod->tracepoints, | ||
| 2197 | mod->tracepoints + mod->num_tracepoints); | ||
| 2198 | #endif | ||
| 2199 | } | 2210 | } |
| 2200 | 2211 | ||
| 2201 | /* sechdrs[0].sh_size is always zero */ | 2212 | /* sechdrs[0].sh_size is always zero */ |
| 2202 | mseg = section_objs(hdr, sechdrs, secstrings, "__mcount_loc", | 2213 | mseg = section_objs(hdr, sechdrs, secstrings, "__mcount_loc", |
| 2203 | sizeof(*mseg), &num_mcount); | 2214 | sizeof(*mseg), &num_mcount); |
| 2204 | ftrace_init_module(mseg, mseg + num_mcount); | 2215 | ftrace_init_module(mod, mseg, mseg + num_mcount); |
| 2205 | 2216 | ||
| 2206 | err = module_finalize(hdr, sechdrs, mod); | 2217 | err = module_finalize(hdr, sechdrs, mod); |
| 2207 | if (err < 0) | 2218 | if (err < 0) |
| @@ -2249,14 +2260,10 @@ static noinline struct module *load_module(void __user *umod, | |||
| 2249 | add_sect_attrs(mod, hdr->e_shnum, secstrings, sechdrs); | 2260 | add_sect_attrs(mod, hdr->e_shnum, secstrings, sechdrs); |
| 2250 | add_notes_attrs(mod, hdr->e_shnum, secstrings, sechdrs); | 2261 | add_notes_attrs(mod, hdr->e_shnum, secstrings, sechdrs); |
| 2251 | 2262 | ||
| 2252 | /* Size of section 0 is 0, so this works well if no unwind info. */ | ||
| 2253 | mod->unwind_info = unwind_add_table(mod, | ||
| 2254 | (void *)sechdrs[unwindex].sh_addr, | ||
| 2255 | sechdrs[unwindex].sh_size); | ||
| 2256 | |||
| 2257 | /* Get rid of temporary copy */ | 2263 | /* Get rid of temporary copy */ |
| 2258 | vfree(hdr); | 2264 | vfree(hdr); |
| 2259 | 2265 | ||
| 2266 | stop_machine_destroy(); | ||
| 2260 | /* Done! */ | 2267 | /* Done! */ |
| 2261 | return mod; | 2268 | return mod; |
| 2262 | 2269 | ||
| @@ -2279,6 +2286,7 @@ static noinline struct module *load_module(void __user *umod, | |||
| 2279 | kfree(args); | 2286 | kfree(args); |
| 2280 | free_hdr: | 2287 | free_hdr: |
| 2281 | vfree(hdr); | 2288 | vfree(hdr); |
| 2289 | stop_machine_destroy(); | ||
| 2282 | return ERR_PTR(err); | 2290 | return ERR_PTR(err); |
| 2283 | 2291 | ||
| 2284 | truncated: | 2292 | truncated: |
| @@ -2288,10 +2296,8 @@ static noinline struct module *load_module(void __user *umod, | |||
| 2288 | } | 2296 | } |
| 2289 | 2297 | ||
| 2290 | /* This is where the real work happens */ | 2298 | /* This is where the real work happens */ |
| 2291 | asmlinkage long | 2299 | SYSCALL_DEFINE3(init_module, void __user *, umod, |
| 2292 | sys_init_module(void __user *umod, | 2300 | unsigned long, len, const char __user *, uargs) |
| 2293 | unsigned long len, | ||
| 2294 | const char __user *uargs) | ||
| 2295 | { | 2301 | { |
| 2296 | struct module *mod; | 2302 | struct module *mod; |
| 2297 | int ret = 0; | 2303 | int ret = 0; |
| @@ -2346,11 +2352,12 @@ sys_init_module(void __user *umod, | |||
| 2346 | /* Now it's a first class citizen! Wake up anyone waiting for it. */ | 2352 | /* Now it's a first class citizen! Wake up anyone waiting for it. */ |
| 2347 | mod->state = MODULE_STATE_LIVE; | 2353 | mod->state = MODULE_STATE_LIVE; |
| 2348 | wake_up(&module_wq); | 2354 | wake_up(&module_wq); |
| 2355 | blocking_notifier_call_chain(&module_notify_list, | ||
| 2356 | MODULE_STATE_LIVE, mod); | ||
| 2349 | 2357 | ||
| 2350 | mutex_lock(&module_mutex); | 2358 | mutex_lock(&module_mutex); |
| 2351 | /* Drop initial reference. */ | 2359 | /* Drop initial reference. */ |
| 2352 | module_put(mod); | 2360 | module_put(mod); |
| 2353 | unwind_remove_table(mod->unwind_info, 1); | ||
| 2354 | module_free(mod, mod->module_init); | 2361 | module_free(mod, mod->module_init); |
| 2355 | mod->module_init = NULL; | 2362 | mod->module_init = NULL; |
| 2356 | mod->init_size = 0; | 2363 | mod->init_size = 0; |
| @@ -2385,7 +2392,7 @@ static const char *get_ksymbol(struct module *mod, | |||
| 2385 | unsigned long nextval; | 2392 | unsigned long nextval; |
| 2386 | 2393 | ||
| 2387 | /* At worse, next value is at end of module */ | 2394 | /* At worse, next value is at end of module */ |
| 2388 | if (within(addr, mod->module_init, mod->init_size)) | 2395 | if (within_module_init(addr, mod)) |
| 2389 | nextval = (unsigned long)mod->module_init+mod->init_text_size; | 2396 | nextval = (unsigned long)mod->module_init+mod->init_text_size; |
| 2390 | else | 2397 | else |
| 2391 | nextval = (unsigned long)mod->module_core+mod->core_text_size; | 2398 | nextval = (unsigned long)mod->module_core+mod->core_text_size; |
| @@ -2433,8 +2440,8 @@ const char *module_address_lookup(unsigned long addr, | |||
| 2433 | 2440 | ||
| 2434 | preempt_disable(); | 2441 | preempt_disable(); |
| 2435 | list_for_each_entry_rcu(mod, &modules, list) { | 2442 | list_for_each_entry_rcu(mod, &modules, list) { |
| 2436 | if (within(addr, mod->module_init, mod->init_size) | 2443 | if (within_module_init(addr, mod) || |
| 2437 | || within(addr, mod->module_core, mod->core_size)) { | 2444 | within_module_core(addr, mod)) { |
| 2438 | if (modname) | 2445 | if (modname) |
| 2439 | *modname = mod->name; | 2446 | *modname = mod->name; |
| 2440 | ret = get_ksymbol(mod, addr, size, offset); | 2447 | ret = get_ksymbol(mod, addr, size, offset); |
| @@ -2456,8 +2463,8 @@ int lookup_module_symbol_name(unsigned long addr, char *symname) | |||
| 2456 | 2463 | ||
| 2457 | preempt_disable(); | 2464 | preempt_disable(); |
| 2458 | list_for_each_entry_rcu(mod, &modules, list) { | 2465 | list_for_each_entry_rcu(mod, &modules, list) { |
| 2459 | if (within(addr, mod->module_init, mod->init_size) || | 2466 | if (within_module_init(addr, mod) || |
| 2460 | within(addr, mod->module_core, mod->core_size)) { | 2467 | within_module_core(addr, mod)) { |
| 2461 | const char *sym; | 2468 | const char *sym; |
| 2462 | 2469 | ||
| 2463 | sym = get_ksymbol(mod, addr, NULL, NULL); | 2470 | sym = get_ksymbol(mod, addr, NULL, NULL); |
| @@ -2480,8 +2487,8 @@ int lookup_module_symbol_attrs(unsigned long addr, unsigned long *size, | |||
| 2480 | 2487 | ||
| 2481 | preempt_disable(); | 2488 | preempt_disable(); |
| 2482 | list_for_each_entry_rcu(mod, &modules, list) { | 2489 | list_for_each_entry_rcu(mod, &modules, list) { |
| 2483 | if (within(addr, mod->module_init, mod->init_size) || | 2490 | if (within_module_init(addr, mod) || |
| 2484 | within(addr, mod->module_core, mod->core_size)) { | 2491 | within_module_core(addr, mod)) { |
| 2485 | const char *sym; | 2492 | const char *sym; |
| 2486 | 2493 | ||
| 2487 | sym = get_ksymbol(mod, addr, size, offset); | 2494 | sym = get_ksymbol(mod, addr, size, offset); |
| @@ -2513,7 +2520,7 @@ int module_get_kallsym(unsigned int symnum, unsigned long *value, char *type, | |||
| 2513 | strlcpy(name, mod->strtab + mod->symtab[symnum].st_name, | 2520 | strlcpy(name, mod->strtab + mod->symtab[symnum].st_name, |
| 2514 | KSYM_NAME_LEN); | 2521 | KSYM_NAME_LEN); |
| 2515 | strlcpy(module_name, mod->name, MODULE_NAME_LEN); | 2522 | strlcpy(module_name, mod->name, MODULE_NAME_LEN); |
| 2516 | *exported = is_exported(name, mod); | 2523 | *exported = is_exported(name, *value, mod); |
| 2517 | preempt_enable(); | 2524 | preempt_enable(); |
| 2518 | return 0; | 2525 | return 0; |
| 2519 | } | 2526 | } |
| @@ -2700,7 +2707,7 @@ int is_module_address(unsigned long addr) | |||
| 2700 | preempt_disable(); | 2707 | preempt_disable(); |
| 2701 | 2708 | ||
| 2702 | list_for_each_entry_rcu(mod, &modules, list) { | 2709 | list_for_each_entry_rcu(mod, &modules, list) { |
| 2703 | if (within(addr, mod->module_core, mod->core_size)) { | 2710 | if (within_module_core(addr, mod)) { |
| 2704 | preempt_enable(); | 2711 | preempt_enable(); |
| 2705 | return 1; | 2712 | return 1; |
| 2706 | } | 2713 | } |
| @@ -2713,7 +2720,7 @@ int is_module_address(unsigned long addr) | |||
| 2713 | 2720 | ||
| 2714 | 2721 | ||
| 2715 | /* Is this a valid kernel address? */ | 2722 | /* Is this a valid kernel address? */ |
| 2716 | struct module *__module_text_address(unsigned long addr) | 2723 | __notrace_funcgraph struct module *__module_text_address(unsigned long addr) |
| 2717 | { | 2724 | { |
| 2718 | struct module *mod; | 2725 | struct module *mod; |
| 2719 | 2726 | ||
