aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-08-11 00:31:58 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-08-11 00:31:58 -0400
commitc8d6637d0497d62093dbba0694c7b3a80b79bfe1 (patch)
tree4ef432511fa6fa959429e1fc961fb186f1745e54 /kernel
parent801a71a858631109a64bf30b1c480b0a18386605 (diff)
parent76215b04fd297c008b91ece732ed36e67e0181fa (diff)
Merge tag 'modules-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux
Pull module updates from Rusty Russell: "This finally applies the stricter sysfs perms checking we pulled out before last merge window. A few stragglers are fixed (thanks linux-next!)" * tag 'modules-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux: arch/powerpc/platforms/powernv/opal-dump.c: fix world-writable sysfs files arch/powerpc/platforms/powernv/opal-elog.c: fix world-writable sysfs files drivers/video/fbdev/s3c2410fb.c: don't make debug world-writable. ARM: avoid ARM binutils leaking ELF local symbols scripts: modpost: Remove numeric suffix pattern matching scripts: modpost: fix compilation warning sysfs: disallow world-writable files. module: return bool from within_module*() module: add within_module() function modules: Fix build error in moduleloader.h
Diffstat (limited to 'kernel')
-rw-r--r--kernel/module.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/kernel/module.c b/kernel/module.c
index ae79ce615cb9..6f69463f0066 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -3381,6 +3381,8 @@ static inline int within(unsigned long addr, void *start, unsigned long size)
3381 */ 3381 */
3382static inline int is_arm_mapping_symbol(const char *str) 3382static inline int is_arm_mapping_symbol(const char *str)
3383{ 3383{
3384 if (str[0] == '.' && str[1] == 'L')
3385 return true;
3384 return str[0] == '$' && strchr("atd", str[1]) 3386 return str[0] == '$' && strchr("atd", str[1])
3385 && (str[2] == '\0' || str[2] == '.'); 3387 && (str[2] == '\0' || str[2] == '.');
3386} 3388}
@@ -3444,8 +3446,7 @@ const char *module_address_lookup(unsigned long addr,
3444 list_for_each_entry_rcu(mod, &modules, list) { 3446 list_for_each_entry_rcu(mod, &modules, list) {
3445 if (mod->state == MODULE_STATE_UNFORMED) 3447 if (mod->state == MODULE_STATE_UNFORMED)
3446 continue; 3448 continue;
3447 if (within_module_init(addr, mod) || 3449 if (within_module(addr, mod)) {
3448 within_module_core(addr, mod)) {
3449 if (modname) 3450 if (modname)
3450 *modname = mod->name; 3451 *modname = mod->name;
3451 ret = get_ksymbol(mod, addr, size, offset); 3452 ret = get_ksymbol(mod, addr, size, offset);
@@ -3469,8 +3470,7 @@ int lookup_module_symbol_name(unsigned long addr, char *symname)
3469 list_for_each_entry_rcu(mod, &modules, list) { 3470 list_for_each_entry_rcu(mod, &modules, list) {
3470 if (mod->state == MODULE_STATE_UNFORMED) 3471 if (mod->state == MODULE_STATE_UNFORMED)
3471 continue; 3472 continue;
3472 if (within_module_init(addr, mod) || 3473 if (within_module(addr, mod)) {
3473 within_module_core(addr, mod)) {
3474 const char *sym; 3474 const char *sym;
3475 3475
3476 sym = get_ksymbol(mod, addr, NULL, NULL); 3476 sym = get_ksymbol(mod, addr, NULL, NULL);
@@ -3495,8 +3495,7 @@ int lookup_module_symbol_attrs(unsigned long addr, unsigned long *size,
3495 list_for_each_entry_rcu(mod, &modules, list) { 3495 list_for_each_entry_rcu(mod, &modules, list) {
3496 if (mod->state == MODULE_STATE_UNFORMED) 3496 if (mod->state == MODULE_STATE_UNFORMED)
3497 continue; 3497 continue;
3498 if (within_module_init(addr, mod) || 3498 if (within_module(addr, mod)) {
3499 within_module_core(addr, mod)) {
3500 const char *sym; 3499 const char *sym;
3501 3500
3502 sym = get_ksymbol(mod, addr, size, offset); 3501 sym = get_ksymbol(mod, addr, size, offset);
@@ -3760,8 +3759,7 @@ struct module *__module_address(unsigned long addr)
3760 list_for_each_entry_rcu(mod, &modules, list) { 3759 list_for_each_entry_rcu(mod, &modules, list) {
3761 if (mod->state == MODULE_STATE_UNFORMED) 3760 if (mod->state == MODULE_STATE_UNFORMED)
3762 continue; 3761 continue;
3763 if (within_module_core(addr, mod) 3762 if (within_module(addr, mod))
3764 || within_module_init(addr, mod))
3765 return mod; 3763 return mod;
3766 } 3764 }
3767 return NULL; 3765 return NULL;