diff options
Diffstat (limited to 'kernel/module.c')
| -rw-r--r-- | kernel/module.c | 201 |
1 files changed, 169 insertions, 32 deletions
diff --git a/kernel/module.c b/kernel/module.c index 2d537186191f..8b7d8805819d 100644 --- a/kernel/module.c +++ b/kernel/module.c | |||
| @@ -47,6 +47,7 @@ | |||
| 47 | #include <linux/rculist.h> | 47 | #include <linux/rculist.h> |
| 48 | #include <asm/uaccess.h> | 48 | #include <asm/uaccess.h> |
| 49 | #include <asm/cacheflush.h> | 49 | #include <asm/cacheflush.h> |
| 50 | #include <asm/mmu_context.h> | ||
| 50 | #include <linux/license.h> | 51 | #include <linux/license.h> |
| 51 | #include <asm/sections.h> | 52 | #include <asm/sections.h> |
| 52 | #include <linux/tracepoint.h> | 53 | #include <linux/tracepoint.h> |
| @@ -55,6 +56,11 @@ | |||
| 55 | #include <linux/percpu.h> | 56 | #include <linux/percpu.h> |
| 56 | #include <linux/kmemleak.h> | 57 | #include <linux/kmemleak.h> |
| 57 | 58 | ||
| 59 | #define CREATE_TRACE_POINTS | ||
| 60 | #include <trace/events/module.h> | ||
| 61 | |||
| 62 | EXPORT_TRACEPOINT_SYMBOL(module_get); | ||
| 63 | |||
| 58 | #if 0 | 64 | #if 0 |
| 59 | #define DEBUGP printk | 65 | #define DEBUGP printk |
| 60 | #else | 66 | #else |
| @@ -364,7 +370,7 @@ EXPORT_SYMBOL_GPL(find_module); | |||
| 364 | 370 | ||
| 365 | #ifdef CONFIG_SMP | 371 | #ifdef CONFIG_SMP |
| 366 | 372 | ||
| 367 | #ifdef CONFIG_HAVE_DYNAMIC_PER_CPU_AREA | 373 | #ifndef CONFIG_HAVE_LEGACY_PER_CPU_AREA |
| 368 | 374 | ||
| 369 | static void *percpu_modalloc(unsigned long size, unsigned long align, | 375 | static void *percpu_modalloc(unsigned long size, unsigned long align, |
| 370 | const char *name) | 376 | const char *name) |
| @@ -389,7 +395,7 @@ static void percpu_modfree(void *freeme) | |||
| 389 | free_percpu(freeme); | 395 | free_percpu(freeme); |
| 390 | } | 396 | } |
| 391 | 397 | ||
| 392 | #else /* ... !CONFIG_HAVE_DYNAMIC_PER_CPU_AREA */ | 398 | #else /* ... CONFIG_HAVE_LEGACY_PER_CPU_AREA */ |
| 393 | 399 | ||
| 394 | /* Number of blocks used and allocated. */ | 400 | /* Number of blocks used and allocated. */ |
| 395 | static unsigned int pcpu_num_used, pcpu_num_allocated; | 401 | static unsigned int pcpu_num_used, pcpu_num_allocated; |
| @@ -535,7 +541,7 @@ static int percpu_modinit(void) | |||
| 535 | } | 541 | } |
| 536 | __initcall(percpu_modinit); | 542 | __initcall(percpu_modinit); |
| 537 | 543 | ||
| 538 | #endif /* CONFIG_HAVE_DYNAMIC_PER_CPU_AREA */ | 544 | #endif /* CONFIG_HAVE_LEGACY_PER_CPU_AREA */ |
| 539 | 545 | ||
| 540 | static unsigned int find_pcpusec(Elf_Ehdr *hdr, | 546 | static unsigned int find_pcpusec(Elf_Ehdr *hdr, |
| 541 | Elf_Shdr *sechdrs, | 547 | Elf_Shdr *sechdrs, |
| @@ -942,6 +948,8 @@ void module_put(struct module *module) | |||
| 942 | if (module) { | 948 | if (module) { |
| 943 | unsigned int cpu = get_cpu(); | 949 | unsigned int cpu = get_cpu(); |
| 944 | local_dec(__module_ref_addr(module, cpu)); | 950 | local_dec(__module_ref_addr(module, cpu)); |
| 951 | trace_module_put(module, _RET_IP_, | ||
| 952 | local_read(__module_ref_addr(module, cpu))); | ||
| 945 | /* Maybe they're waiting for us to drop reference? */ | 953 | /* Maybe they're waiting for us to drop reference? */ |
| 946 | if (unlikely(!module_is_live(module))) | 954 | if (unlikely(!module_is_live(module))) |
| 947 | wake_up_process(module->waiter); | 955 | wake_up_process(module->waiter); |
| @@ -1497,6 +1505,8 @@ static int __unlink_module(void *_mod) | |||
| 1497 | /* Free a module, remove from lists, etc (must hold module_mutex). */ | 1505 | /* Free a module, remove from lists, etc (must hold module_mutex). */ |
| 1498 | static void free_module(struct module *mod) | 1506 | static void free_module(struct module *mod) |
| 1499 | { | 1507 | { |
| 1508 | trace_module_free(mod); | ||
| 1509 | |||
| 1500 | /* Delete from various lists */ | 1510 | /* Delete from various lists */ |
| 1501 | stop_machine(__unlink_module, mod, NULL); | 1511 | stop_machine(__unlink_module, mod, NULL); |
| 1502 | remove_notes_attrs(mod); | 1512 | remove_notes_attrs(mod); |
| @@ -1526,6 +1536,10 @@ static void free_module(struct module *mod) | |||
| 1526 | 1536 | ||
| 1527 | /* Finally, free the core (containing the module structure) */ | 1537 | /* Finally, free the core (containing the module structure) */ |
| 1528 | module_free(mod, mod->module_core); | 1538 | module_free(mod, mod->module_core); |
| 1539 | |||
| 1540 | #ifdef CONFIG_MPU | ||
| 1541 | update_protections(current->mm); | ||
| 1542 | #endif | ||
| 1529 | } | 1543 | } |
| 1530 | 1544 | ||
| 1531 | void *__symbol_get(const char *symbol) | 1545 | void *__symbol_get(const char *symbol) |
| @@ -1783,6 +1797,17 @@ static void setup_modinfo(struct module *mod, Elf_Shdr *sechdrs, | |||
| 1783 | } | 1797 | } |
| 1784 | } | 1798 | } |
| 1785 | 1799 | ||
| 1800 | static void free_modinfo(struct module *mod) | ||
| 1801 | { | ||
| 1802 | struct module_attribute *attr; | ||
| 1803 | int i; | ||
| 1804 | |||
| 1805 | for (i = 0; (attr = modinfo_attrs[i]); i++) { | ||
| 1806 | if (attr->free) | ||
| 1807 | attr->free(mod); | ||
| 1808 | } | ||
| 1809 | } | ||
| 1810 | |||
| 1786 | #ifdef CONFIG_KALLSYMS | 1811 | #ifdef CONFIG_KALLSYMS |
| 1787 | 1812 | ||
| 1788 | /* lookup symbol in given range of kernel_symbols */ | 1813 | /* lookup symbol in given range of kernel_symbols */ |
| @@ -1848,13 +1873,93 @@ static char elf_type(const Elf_Sym *sym, | |||
| 1848 | return '?'; | 1873 | return '?'; |
| 1849 | } | 1874 | } |
| 1850 | 1875 | ||
| 1876 | static bool is_core_symbol(const Elf_Sym *src, const Elf_Shdr *sechdrs, | ||
| 1877 | unsigned int shnum) | ||
| 1878 | { | ||
| 1879 | const Elf_Shdr *sec; | ||
| 1880 | |||
| 1881 | if (src->st_shndx == SHN_UNDEF | ||
| 1882 | || src->st_shndx >= shnum | ||
| 1883 | || !src->st_name) | ||
| 1884 | return false; | ||
| 1885 | |||
| 1886 | sec = sechdrs + src->st_shndx; | ||
| 1887 | if (!(sec->sh_flags & SHF_ALLOC) | ||
| 1888 | #ifndef CONFIG_KALLSYMS_ALL | ||
| 1889 | || !(sec->sh_flags & SHF_EXECINSTR) | ||
| 1890 | #endif | ||
| 1891 | || (sec->sh_entsize & INIT_OFFSET_MASK)) | ||
| 1892 | return false; | ||
| 1893 | |||
| 1894 | return true; | ||
| 1895 | } | ||
| 1896 | |||
| 1897 | static unsigned long layout_symtab(struct module *mod, | ||
| 1898 | Elf_Shdr *sechdrs, | ||
| 1899 | unsigned int symindex, | ||
| 1900 | unsigned int strindex, | ||
| 1901 | const Elf_Ehdr *hdr, | ||
| 1902 | const char *secstrings, | ||
| 1903 | unsigned long *pstroffs, | ||
| 1904 | unsigned long *strmap) | ||
| 1905 | { | ||
| 1906 | unsigned long symoffs; | ||
| 1907 | Elf_Shdr *symsect = sechdrs + symindex; | ||
| 1908 | Elf_Shdr *strsect = sechdrs + strindex; | ||
| 1909 | const Elf_Sym *src; | ||
| 1910 | const char *strtab; | ||
| 1911 | unsigned int i, nsrc, ndst; | ||
| 1912 | |||
| 1913 | /* Put symbol section at end of init part of module. */ | ||
| 1914 | symsect->sh_flags |= SHF_ALLOC; | ||
| 1915 | symsect->sh_entsize = get_offset(mod, &mod->init_size, symsect, | ||
| 1916 | symindex) | INIT_OFFSET_MASK; | ||
| 1917 | DEBUGP("\t%s\n", secstrings + symsect->sh_name); | ||
| 1918 | |||
| 1919 | src = (void *)hdr + symsect->sh_offset; | ||
| 1920 | nsrc = symsect->sh_size / sizeof(*src); | ||
| 1921 | strtab = (void *)hdr + strsect->sh_offset; | ||
| 1922 | for (ndst = i = 1; i < nsrc; ++i, ++src) | ||
| 1923 | if (is_core_symbol(src, sechdrs, hdr->e_shnum)) { | ||
| 1924 | unsigned int j = src->st_name; | ||
| 1925 | |||
| 1926 | while(!__test_and_set_bit(j, strmap) && strtab[j]) | ||
| 1927 | ++j; | ||
| 1928 | ++ndst; | ||
| 1929 | } | ||
| 1930 | |||
| 1931 | /* Append room for core symbols at end of core part. */ | ||
| 1932 | symoffs = ALIGN(mod->core_size, symsect->sh_addralign ?: 1); | ||
| 1933 | mod->core_size = symoffs + ndst * sizeof(Elf_Sym); | ||
| 1934 | |||
| 1935 | /* Put string table section at end of init part of module. */ | ||
| 1936 | strsect->sh_flags |= SHF_ALLOC; | ||
| 1937 | strsect->sh_entsize = get_offset(mod, &mod->init_size, strsect, | ||
| 1938 | strindex) | INIT_OFFSET_MASK; | ||
| 1939 | DEBUGP("\t%s\n", secstrings + strsect->sh_name); | ||
| 1940 | |||
| 1941 | /* Append room for core symbols' strings at end of core part. */ | ||
| 1942 | *pstroffs = mod->core_size; | ||
| 1943 | __set_bit(0, strmap); | ||
| 1944 | mod->core_size += bitmap_weight(strmap, strsect->sh_size); | ||
| 1945 | |||
| 1946 | return symoffs; | ||
| 1947 | } | ||
| 1948 | |||
| 1851 | static void add_kallsyms(struct module *mod, | 1949 | static void add_kallsyms(struct module *mod, |
| 1852 | Elf_Shdr *sechdrs, | 1950 | Elf_Shdr *sechdrs, |
| 1951 | unsigned int shnum, | ||
| 1853 | unsigned int symindex, | 1952 | unsigned int symindex, |
| 1854 | unsigned int strindex, | 1953 | unsigned int strindex, |
| 1855 | const char *secstrings) | 1954 | unsigned long symoffs, |
| 1955 | unsigned long stroffs, | ||
| 1956 | const char *secstrings, | ||
| 1957 | unsigned long *strmap) | ||
| 1856 | { | 1958 | { |
| 1857 | unsigned int i; | 1959 | unsigned int i, ndst; |
| 1960 | const Elf_Sym *src; | ||
| 1961 | Elf_Sym *dst; | ||
| 1962 | char *s; | ||
| 1858 | 1963 | ||
| 1859 | mod->symtab = (void *)sechdrs[symindex].sh_addr; | 1964 | mod->symtab = (void *)sechdrs[symindex].sh_addr; |
| 1860 | mod->num_symtab = sechdrs[symindex].sh_size / sizeof(Elf_Sym); | 1965 | mod->num_symtab = sechdrs[symindex].sh_size / sizeof(Elf_Sym); |
| @@ -1864,13 +1969,46 @@ static void add_kallsyms(struct module *mod, | |||
| 1864 | for (i = 0; i < mod->num_symtab; i++) | 1969 | for (i = 0; i < mod->num_symtab; i++) |
| 1865 | mod->symtab[i].st_info | 1970 | mod->symtab[i].st_info |
| 1866 | = elf_type(&mod->symtab[i], sechdrs, secstrings, mod); | 1971 | = elf_type(&mod->symtab[i], sechdrs, secstrings, mod); |
| 1972 | |||
| 1973 | mod->core_symtab = dst = mod->module_core + symoffs; | ||
| 1974 | src = mod->symtab; | ||
| 1975 | *dst = *src; | ||
| 1976 | for (ndst = i = 1; i < mod->num_symtab; ++i, ++src) { | ||
| 1977 | if (!is_core_symbol(src, sechdrs, shnum)) | ||
| 1978 | continue; | ||
| 1979 | dst[ndst] = *src; | ||
| 1980 | dst[ndst].st_name = bitmap_weight(strmap, dst[ndst].st_name); | ||
| 1981 | ++ndst; | ||
| 1982 | } | ||
| 1983 | mod->core_num_syms = ndst; | ||
| 1984 | |||
| 1985 | mod->core_strtab = s = mod->module_core + stroffs; | ||
| 1986 | for (*s = 0, i = 1; i < sechdrs[strindex].sh_size; ++i) | ||
| 1987 | if (test_bit(i, strmap)) | ||
| 1988 | *++s = mod->strtab[i]; | ||
| 1867 | } | 1989 | } |
| 1868 | #else | 1990 | #else |
| 1991 | static inline unsigned long layout_symtab(struct module *mod, | ||
| 1992 | Elf_Shdr *sechdrs, | ||
| 1993 | unsigned int symindex, | ||
| 1994 | unsigned int strindex, | ||
| 1995 | const Elf_Ehdr *hdr, | ||
| 1996 | const char *secstrings, | ||
| 1997 | unsigned long *pstroffs, | ||
| 1998 | unsigned long *strmap) | ||
| 1999 | { | ||
| 2000 | return 0; | ||
| 2001 | } | ||
| 2002 | |||
| 1869 | static inline void add_kallsyms(struct module *mod, | 2003 | static inline void add_kallsyms(struct module *mod, |
| 1870 | Elf_Shdr *sechdrs, | 2004 | Elf_Shdr *sechdrs, |
| 2005 | unsigned int shnum, | ||
| 1871 | unsigned int symindex, | 2006 | unsigned int symindex, |
| 1872 | unsigned int strindex, | 2007 | unsigned int strindex, |
| 1873 | const char *secstrings) | 2008 | unsigned long symoffs, |
| 2009 | unsigned long stroffs, | ||
| 2010 | const char *secstrings, | ||
| 2011 | const unsigned long *strmap) | ||
| 1874 | { | 2012 | { |
| 1875 | } | 2013 | } |
| 1876 | #endif /* CONFIG_KALLSYMS */ | 2014 | #endif /* CONFIG_KALLSYMS */ |
| @@ -1945,6 +2083,8 @@ static noinline struct module *load_module(void __user *umod, | |||
| 1945 | struct module *mod; | 2083 | struct module *mod; |
| 1946 | long err = 0; | 2084 | long err = 0; |
| 1947 | void *percpu = NULL, *ptr = NULL; /* Stops spurious gcc warning */ | 2085 | void *percpu = NULL, *ptr = NULL; /* Stops spurious gcc warning */ |
| 2086 | unsigned long symoffs, stroffs, *strmap; | ||
| 2087 | |||
| 1948 | mm_segment_t old_fs; | 2088 | mm_segment_t old_fs; |
| 1949 | 2089 | ||
| 1950 | DEBUGP("load_module: umod=%p, len=%lu, uargs=%p\n", | 2090 | DEBUGP("load_module: umod=%p, len=%lu, uargs=%p\n", |
| @@ -2026,11 +2166,6 @@ static noinline struct module *load_module(void __user *umod, | |||
| 2026 | /* Don't keep modinfo and version sections. */ | 2166 | /* Don't keep modinfo and version sections. */ |
| 2027 | sechdrs[infoindex].sh_flags &= ~(unsigned long)SHF_ALLOC; | 2167 | sechdrs[infoindex].sh_flags &= ~(unsigned long)SHF_ALLOC; |
| 2028 | sechdrs[versindex].sh_flags &= ~(unsigned long)SHF_ALLOC; | 2168 | sechdrs[versindex].sh_flags &= ~(unsigned long)SHF_ALLOC; |
| 2029 | #ifdef CONFIG_KALLSYMS | ||
| 2030 | /* Keep symbol and string tables for decoding later. */ | ||
| 2031 | sechdrs[symindex].sh_flags |= SHF_ALLOC; | ||
| 2032 | sechdrs[strindex].sh_flags |= SHF_ALLOC; | ||
| 2033 | #endif | ||
| 2034 | 2169 | ||
| 2035 | /* Check module struct version now, before we try to use module. */ | 2170 | /* Check module struct version now, before we try to use module. */ |
| 2036 | if (!check_modstruct_version(sechdrs, versindex, mod)) { | 2171 | if (!check_modstruct_version(sechdrs, versindex, mod)) { |
| @@ -2066,6 +2201,13 @@ static noinline struct module *load_module(void __user *umod, | |||
| 2066 | goto free_hdr; | 2201 | goto free_hdr; |
| 2067 | } | 2202 | } |
| 2068 | 2203 | ||
| 2204 | strmap = kzalloc(BITS_TO_LONGS(sechdrs[strindex].sh_size) | ||
| 2205 | * sizeof(long), GFP_KERNEL); | ||
| 2206 | if (!strmap) { | ||
| 2207 | err = -ENOMEM; | ||
| 2208 | goto free_mod; | ||
| 2209 | } | ||
| 2210 | |||
| 2069 | if (find_module(mod->name)) { | 2211 | if (find_module(mod->name)) { |
| 2070 | err = -EEXIST; | 2212 | err = -EEXIST; |
| 2071 | goto free_mod; | 2213 | goto free_mod; |
| @@ -2095,6 +2237,8 @@ static noinline struct module *load_module(void __user *umod, | |||
| 2095 | this is done generically; there doesn't appear to be any | 2237 | this is done generically; there doesn't appear to be any |
| 2096 | special cases for the architectures. */ | 2238 | special cases for the architectures. */ |
| 2097 | layout_sections(mod, hdr, sechdrs, secstrings); | 2239 | layout_sections(mod, hdr, sechdrs, secstrings); |
| 2240 | symoffs = layout_symtab(mod, sechdrs, symindex, strindex, hdr, | ||
| 2241 | secstrings, &stroffs, strmap); | ||
| 2098 | 2242 | ||
| 2099 | /* Do the allocs. */ | 2243 | /* Do the allocs. */ |
| 2100 | ptr = module_alloc_update_bounds(mod->core_size); | 2244 | ptr = module_alloc_update_bounds(mod->core_size); |
| @@ -2228,10 +2372,6 @@ static noinline struct module *load_module(void __user *umod, | |||
| 2228 | sizeof(*mod->ctors), &mod->num_ctors); | 2372 | sizeof(*mod->ctors), &mod->num_ctors); |
| 2229 | #endif | 2373 | #endif |
| 2230 | 2374 | ||
| 2231 | #ifdef CONFIG_MARKERS | ||
| 2232 | mod->markers = section_objs(hdr, sechdrs, secstrings, "__markers", | ||
| 2233 | sizeof(*mod->markers), &mod->num_markers); | ||
| 2234 | #endif | ||
| 2235 | #ifdef CONFIG_TRACEPOINTS | 2375 | #ifdef CONFIG_TRACEPOINTS |
| 2236 | mod->tracepoints = section_objs(hdr, sechdrs, secstrings, | 2376 | mod->tracepoints = section_objs(hdr, sechdrs, secstrings, |
| 2237 | "__tracepoints", | 2377 | "__tracepoints", |
| @@ -2303,7 +2443,10 @@ static noinline struct module *load_module(void __user *umod, | |||
| 2303 | percpu_modcopy(mod->percpu, (void *)sechdrs[pcpuindex].sh_addr, | 2443 | percpu_modcopy(mod->percpu, (void *)sechdrs[pcpuindex].sh_addr, |
| 2304 | sechdrs[pcpuindex].sh_size); | 2444 | sechdrs[pcpuindex].sh_size); |
| 2305 | 2445 | ||
| 2306 | add_kallsyms(mod, sechdrs, symindex, strindex, secstrings); | 2446 | add_kallsyms(mod, sechdrs, hdr->e_shnum, symindex, strindex, |
| 2447 | symoffs, stroffs, secstrings, strmap); | ||
| 2448 | kfree(strmap); | ||
| 2449 | strmap = NULL; | ||
| 2307 | 2450 | ||
| 2308 | if (!mod->taints) { | 2451 | if (!mod->taints) { |
| 2309 | struct _ddebug *debug; | 2452 | struct _ddebug *debug; |
| @@ -2364,6 +2507,8 @@ static noinline struct module *load_module(void __user *umod, | |||
| 2364 | /* Get rid of temporary copy */ | 2507 | /* Get rid of temporary copy */ |
| 2365 | vfree(hdr); | 2508 | vfree(hdr); |
| 2366 | 2509 | ||
| 2510 | trace_module_load(mod); | ||
| 2511 | |||
| 2367 | /* Done! */ | 2512 | /* Done! */ |
| 2368 | return mod; | 2513 | return mod; |
| 2369 | 2514 | ||
| @@ -2373,13 +2518,14 @@ static noinline struct module *load_module(void __user *umod, | |||
| 2373 | synchronize_sched(); | 2518 | synchronize_sched(); |
| 2374 | module_arch_cleanup(mod); | 2519 | module_arch_cleanup(mod); |
| 2375 | cleanup: | 2520 | cleanup: |
| 2521 | free_modinfo(mod); | ||
| 2376 | kobject_del(&mod->mkobj.kobj); | 2522 | kobject_del(&mod->mkobj.kobj); |
| 2377 | kobject_put(&mod->mkobj.kobj); | 2523 | kobject_put(&mod->mkobj.kobj); |
| 2378 | free_unload: | 2524 | free_unload: |
| 2379 | module_unload_free(mod); | 2525 | module_unload_free(mod); |
| 2380 | #if defined(CONFIG_MODULE_UNLOAD) && defined(CONFIG_SMP) | 2526 | #if defined(CONFIG_MODULE_UNLOAD) && defined(CONFIG_SMP) |
| 2381 | free_init: | ||
| 2382 | percpu_modfree(mod->refptr); | 2527 | percpu_modfree(mod->refptr); |
| 2528 | free_init: | ||
| 2383 | #endif | 2529 | #endif |
| 2384 | module_free(mod, mod->module_init); | 2530 | module_free(mod, mod->module_init); |
| 2385 | free_core: | 2531 | free_core: |
| @@ -2390,6 +2536,7 @@ static noinline struct module *load_module(void __user *umod, | |||
| 2390 | percpu_modfree(percpu); | 2536 | percpu_modfree(percpu); |
| 2391 | free_mod: | 2537 | free_mod: |
| 2392 | kfree(args); | 2538 | kfree(args); |
| 2539 | kfree(strmap); | ||
| 2393 | free_hdr: | 2540 | free_hdr: |
| 2394 | vfree(hdr); | 2541 | vfree(hdr); |
| 2395 | return ERR_PTR(err); | 2542 | return ERR_PTR(err); |
| @@ -2479,6 +2626,11 @@ SYSCALL_DEFINE3(init_module, void __user *, umod, | |||
| 2479 | /* Drop initial reference. */ | 2626 | /* Drop initial reference. */ |
| 2480 | module_put(mod); | 2627 | module_put(mod); |
| 2481 | trim_init_extable(mod); | 2628 | trim_init_extable(mod); |
| 2629 | #ifdef CONFIG_KALLSYMS | ||
| 2630 | mod->num_symtab = mod->core_num_syms; | ||
| 2631 | mod->symtab = mod->core_symtab; | ||
| 2632 | mod->strtab = mod->core_strtab; | ||
| 2633 | #endif | ||
| 2482 | module_free(mod, mod->module_init); | 2634 | module_free(mod, mod->module_init); |
| 2483 | mod->module_init = NULL; | 2635 | mod->module_init = NULL; |
| 2484 | mod->init_size = 0; | 2636 | mod->init_size = 0; |
| @@ -2940,27 +3092,12 @@ void module_layout(struct module *mod, | |||
| 2940 | struct modversion_info *ver, | 3092 | struct modversion_info *ver, |
| 2941 | struct kernel_param *kp, | 3093 | struct kernel_param *kp, |
| 2942 | struct kernel_symbol *ks, | 3094 | struct kernel_symbol *ks, |
| 2943 | struct marker *marker, | ||
| 2944 | struct tracepoint *tp) | 3095 | struct tracepoint *tp) |
| 2945 | { | 3096 | { |
| 2946 | } | 3097 | } |
| 2947 | EXPORT_SYMBOL(module_layout); | 3098 | EXPORT_SYMBOL(module_layout); |
| 2948 | #endif | 3099 | #endif |
| 2949 | 3100 | ||
| 2950 | #ifdef CONFIG_MARKERS | ||
| 2951 | void module_update_markers(void) | ||
| 2952 | { | ||
| 2953 | struct module *mod; | ||
| 2954 | |||
| 2955 | mutex_lock(&module_mutex); | ||
| 2956 | list_for_each_entry(mod, &modules, list) | ||
| 2957 | if (!mod->taints) | ||
| 2958 | marker_update_probe_range(mod->markers, | ||
| 2959 | mod->markers + mod->num_markers); | ||
| 2960 | mutex_unlock(&module_mutex); | ||
| 2961 | } | ||
| 2962 | #endif | ||
| 2963 | |||
| 2964 | #ifdef CONFIG_TRACEPOINTS | 3101 | #ifdef CONFIG_TRACEPOINTS |
| 2965 | void module_update_tracepoints(void) | 3102 | void module_update_tracepoints(void) |
| 2966 | { | 3103 | { |
