git://ftp.safe.ca
/
safe
/
jmp
/
linux-2.6
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
kprobes: rename kprobe_enabled to kprobes_all_disarmed
[safe/jmp/linux-2.6]
/
kernel
/
module.c
diff --git
a/kernel/module.c
b/kernel/module.c
index
e8cf636
..
05f014e
100644
(file)
--- a/
kernel/module.c
+++ b/
kernel/module.c
@@
-1673,8
+1673,7
@@
static void layout_sections(struct module *mod,
if ((s->sh_flags & masks[m][0]) != masks[m][0]
|| (s->sh_flags & masks[m][1])
|| s->sh_entsize != ~0UL
if ((s->sh_flags & masks[m][0]) != masks[m][0]
|| (s->sh_flags & masks[m][1])
|| s->sh_entsize != ~0UL
- || strncmp(secstrings + s->sh_name,
- ".init", 5) == 0)
+ || strstarts(secstrings + s->sh_name, ".init"))
continue;
s->sh_entsize = get_offset(mod, &mod->core_size, s, i);
DEBUGP("\t%s\n", secstrings + s->sh_name);
continue;
s->sh_entsize = get_offset(mod, &mod->core_size, s, i);
DEBUGP("\t%s\n", secstrings + s->sh_name);
@@
-1691,8
+1690,7
@@
static void layout_sections(struct module *mod,
if ((s->sh_flags & masks[m][0]) != masks[m][0]
|| (s->sh_flags & masks[m][1])
|| s->sh_entsize != ~0UL
if ((s->sh_flags & masks[m][0]) != masks[m][0]
|| (s->sh_flags & masks[m][1])
|| s->sh_entsize != ~0UL
- || strncmp(secstrings + s->sh_name,
- ".init", 5) != 0)
+ || !strstarts(secstrings + s->sh_name, ".init"))
continue;
s->sh_entsize = (get_offset(mod, &mod->init_size, s, i)
| INIT_OFFSET_MASK);
continue;
s->sh_entsize = (get_offset(mod, &mod->init_size, s, i)
| INIT_OFFSET_MASK);
@@
-1825,8
+1823,7
@@
static char elf_type(const Elf_Sym *sym,
else
return 'b';
}
else
return 'b';
}
- if (strncmp(secstrings + sechdrs[sym->st_shndx].sh_name,
- ".debug", strlen(".debug")) == 0)
+ if (strstarts(secstrings + sechdrs[sym->st_shndx].sh_name, ".debug"))
return 'n';
return '?';
}
return 'n';
return '?';
}
@@
-1912,12
+1909,6
@@
static noinline struct module *load_module(void __user *umod,
if (len > 64 * 1024 * 1024 || (hdr = vmalloc(len)) == NULL)
return ERR_PTR(-ENOMEM);
if (len > 64 * 1024 * 1024 || (hdr = vmalloc(len)) == NULL)
return ERR_PTR(-ENOMEM);
- /* Create stop_machine threads since the error path relies on
- * a non-failing stop_machine call. */
- err = stop_machine_create();
- if (err)
- goto free_hdr;
-
if (copy_from_user(hdr, umod, len) != 0) {
err = -EFAULT;
goto free_hdr;
if (copy_from_user(hdr, umod, len) != 0) {
err = -EFAULT;
goto free_hdr;
@@
-1958,12
+1949,9
@@
static noinline struct module *load_module(void __user *umod,
}
#ifndef CONFIG_MODULE_UNLOAD
/* Don't load .exit sections */
}
#ifndef CONFIG_MODULE_UNLOAD
/* Don't load .exit sections */
- if (str
ncmp(secstrings+sechdrs[i].sh_name, ".exit", 5) == 0
)
+ if (str
starts(secstrings+sechdrs[i].sh_name, ".exit")
)
sechdrs[i].sh_flags &= ~(unsigned long)SHF_ALLOC;
#endif
sechdrs[i].sh_flags &= ~(unsigned long)SHF_ALLOC;
#endif
- /* Don't keep __versions around; it's just for loading. */
- if (strcmp(secstrings + sechdrs[i].sh_name, "__versions") == 0)
- sechdrs[i].sh_flags &= ~(unsigned long)SHF_ALLOC;
}
modindex = find_sec(hdr, sechdrs, secstrings,
}
modindex = find_sec(hdr, sechdrs, secstrings,
@@
-2303,12
+2291,13
@@
static noinline struct module *load_module(void __user *umod,
/* Get rid of temporary copy */
vfree(hdr);
/* Get rid of temporary copy */
vfree(hdr);
- stop_machine_destroy();
/* Done! */
return mod;
unlink:
/* Done! */
return mod;
unlink:
- stop_machine(__unlink_module, mod, NULL);
+ /* Unlink carefully: kallsyms could be walking list. */
+ list_del_rcu(&mod->list);
+ synchronize_sched();
module_arch_cleanup(mod);
cleanup:
kobject_del(&mod->mkobj.kobj);
module_arch_cleanup(mod);
cleanup:
kobject_del(&mod->mkobj.kobj);
@@
-2331,7
+2320,6
@@
static noinline struct module *load_module(void __user *umod,
kfree(args);
free_hdr:
vfree(hdr);
kfree(args);
free_hdr:
vfree(hdr);
- stop_machine_destroy();
return ERR_PTR(err);
truncated:
return ERR_PTR(err);
truncated:
@@
-2786,7
+2774,7
@@
bool is_module_address(unsigned long addr)
* Must be called with preempt disabled or module mutex held so that
* module doesn't get freed during this.
*/
* Must be called with preempt disabled or module mutex held so that
* module doesn't get freed during this.
*/
-
__notrace_funcgraph
struct module *__module_address(unsigned long addr)
+struct module *__module_address(unsigned long addr)
{
struct module *mod;
{
struct module *mod;