diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-05-05 13:58:06 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-05-05 13:58:06 -0400 |
| commit | f8ce1faf55955de62e0a12e330c6d9a526071f65 (patch) | |
| tree | a3b0ddd3f37e40d3ed0fd2cd433a2723403c8b97 /kernel/module.c | |
| parent | 24d0c2542b38963ae4d5171ecc0a2c1326c656bc (diff) | |
| parent | a53a11f35762ff1d5e268adedf2ab9ce313f871d (diff) | |
Merge tag 'modules-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux
Pull mudule updates from Rusty Russell:
"We get rid of the general module prefix confusion with a binary config
option, fix a remove/insert race which Never Happens, and (my
favorite) handle the case when we have too many modules for a single
commandline. Seriously, the kernel is full, please go away!"
* tag 'modules-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux:
modpost: fix unwanted VMLINUX_SYMBOL_STR expansion
X.509: Support parse long form of length octets in Authority Key Identifier
module: don't unlink the module until we've removed all exposure.
kernel: kallsyms: memory override issue, need check destination buffer length
MODSIGN: do not send garbage to stderr when enabling modules signature
modpost: handle huge numbers of modules.
modpost: add -T option to read module names from file/stdin.
modpost: minor cleanup.
genksyms: pass symbol-prefix instead of arch
module: fix symbol versioning with symbol prefixes
CONFIG_SYMBOL_PREFIX: cleanup.
Diffstat (limited to 'kernel/module.c')
| -rw-r--r-- | kernel/module.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/kernel/module.c b/kernel/module.c index 0925c9a71975..b049939177f6 100644 --- a/kernel/module.c +++ b/kernel/module.c | |||
| @@ -1209,10 +1209,11 @@ static inline int check_modstruct_version(Elf_Shdr *sechdrs, | |||
| 1209 | 1209 | ||
| 1210 | /* Since this should be found in kernel (which can't be removed), | 1210 | /* Since this should be found in kernel (which can't be removed), |
| 1211 | * no locking is necessary. */ | 1211 | * no locking is necessary. */ |
| 1212 | if (!find_symbol(MODULE_SYMBOL_PREFIX "module_layout", NULL, | 1212 | if (!find_symbol(VMLINUX_SYMBOL_STR(module_layout), NULL, |
| 1213 | &crc, true, false)) | 1213 | &crc, true, false)) |
| 1214 | BUG(); | 1214 | BUG(); |
| 1215 | return check_version(sechdrs, versindex, "module_layout", mod, crc, | 1215 | return check_version(sechdrs, versindex, |
| 1216 | VMLINUX_SYMBOL_STR(module_layout), mod, crc, | ||
| 1216 | NULL); | 1217 | NULL); |
| 1217 | } | 1218 | } |
| 1218 | 1219 | ||
| @@ -1861,12 +1862,12 @@ static void free_module(struct module *mod) | |||
| 1861 | { | 1862 | { |
| 1862 | trace_module_free(mod); | 1863 | trace_module_free(mod); |
| 1863 | 1864 | ||
| 1864 | /* Delete from various lists */ | ||
| 1865 | mutex_lock(&module_mutex); | ||
| 1866 | stop_machine(__unlink_module, mod, NULL); | ||
| 1867 | mutex_unlock(&module_mutex); | ||
| 1868 | mod_sysfs_teardown(mod); | 1865 | mod_sysfs_teardown(mod); |
| 1869 | 1866 | ||
| 1867 | /* We leave it in list to prevent duplicate loads, but make sure | ||
| 1868 | * that noone uses it while it's being deconstructed. */ | ||
| 1869 | mod->state = MODULE_STATE_UNFORMED; | ||
| 1870 | |||
| 1870 | /* Remove dynamic debug info */ | 1871 | /* Remove dynamic debug info */ |
| 1871 | ddebug_remove_module(mod->name); | 1872 | ddebug_remove_module(mod->name); |
| 1872 | 1873 | ||
| @@ -1879,6 +1880,11 @@ static void free_module(struct module *mod) | |||
| 1879 | /* Free any allocated parameters. */ | 1880 | /* Free any allocated parameters. */ |
| 1880 | destroy_params(mod->kp, mod->num_kp); | 1881 | destroy_params(mod->kp, mod->num_kp); |
| 1881 | 1882 | ||
| 1883 | /* Now we can delete it from the lists */ | ||
| 1884 | mutex_lock(&module_mutex); | ||
| 1885 | stop_machine(__unlink_module, mod, NULL); | ||
| 1886 | mutex_unlock(&module_mutex); | ||
| 1887 | |||
| 1882 | /* This may be NULL, but that's OK */ | 1888 | /* This may be NULL, but that's OK */ |
| 1883 | unset_module_init_ro_nx(mod); | 1889 | unset_module_init_ro_nx(mod); |
| 1884 | module_free(mod, mod->module_init); | 1890 | module_free(mod, mod->module_init); |
