diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2012-01-09 02:38:23 -0500 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2012-01-09 02:38:23 -0500 |
commit | da733563be5a9da26fe81d9f007262d00b846e22 (patch) | |
tree | db28291df94a2043af2123911984c5c173da4e6f /kernel/module.c | |
parent | 6ccbcf2cb41131f8d56ef0723bf3f7c1f8486076 (diff) | |
parent | dab78d7924598ea4031663dd10db814e2e324928 (diff) |
Merge branch 'next' into for-linus
Diffstat (limited to 'kernel/module.c')
-rw-r--r-- | kernel/module.c | 60 |
1 files changed, 8 insertions, 52 deletions
diff --git a/kernel/module.c b/kernel/module.c index 04379f92f843..178333c48d1e 100644 --- a/kernel/module.c +++ b/kernel/module.c | |||
@@ -16,7 +16,7 @@ | |||
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
18 | */ | 18 | */ |
19 | #include <linux/module.h> | 19 | #include <linux/export.h> |
20 | #include <linux/moduleloader.h> | 20 | #include <linux/moduleloader.h> |
21 | #include <linux/ftrace_event.h> | 21 | #include <linux/ftrace_event.h> |
22 | #include <linux/init.h> | 22 | #include <linux/init.h> |
@@ -2487,6 +2487,9 @@ static int check_modinfo(struct module *mod, struct load_info *info) | |||
2487 | return -ENOEXEC; | 2487 | return -ENOEXEC; |
2488 | } | 2488 | } |
2489 | 2489 | ||
2490 | if (!get_modinfo(info, "intree")) | ||
2491 | add_taint_module(mod, TAINT_OOT_MODULE); | ||
2492 | |||
2490 | if (get_modinfo(info, "staging")) { | 2493 | if (get_modinfo(info, "staging")) { |
2491 | add_taint_module(mod, TAINT_CRAP); | 2494 | add_taint_module(mod, TAINT_CRAP); |
2492 | printk(KERN_WARNING "%s: module is from the staging directory," | 2495 | printk(KERN_WARNING "%s: module is from the staging directory," |
@@ -2878,8 +2881,7 @@ static struct module *load_module(void __user *umod, | |||
2878 | } | 2881 | } |
2879 | 2882 | ||
2880 | /* This has to be done once we're sure module name is unique. */ | 2883 | /* This has to be done once we're sure module name is unique. */ |
2881 | if (!mod->taints || mod->taints == (1U<<TAINT_CRAP)) | 2884 | dynamic_debug_setup(info.debug, info.num_debug); |
2882 | dynamic_debug_setup(info.debug, info.num_debug); | ||
2883 | 2885 | ||
2884 | /* Find duplicate symbols */ | 2886 | /* Find duplicate symbols */ |
2885 | err = verify_export_symbols(mod); | 2887 | err = verify_export_symbols(mod); |
@@ -2915,8 +2917,7 @@ static struct module *load_module(void __user *umod, | |||
2915 | module_bug_cleanup(mod); | 2917 | module_bug_cleanup(mod); |
2916 | 2918 | ||
2917 | ddebug: | 2919 | ddebug: |
2918 | if (!mod->taints || mod->taints == (1U<<TAINT_CRAP)) | 2920 | dynamic_debug_remove(info.debug); |
2919 | dynamic_debug_remove(info.debug); | ||
2920 | unlock: | 2921 | unlock: |
2921 | mutex_unlock(&module_mutex); | 2922 | mutex_unlock(&module_mutex); |
2922 | synchronize_sched(); | 2923 | synchronize_sched(); |
@@ -3257,6 +3258,8 @@ static char *module_flags(struct module *mod, char *buf) | |||
3257 | buf[bx++] = '('; | 3258 | buf[bx++] = '('; |
3258 | if (mod->taints & (1 << TAINT_PROPRIETARY_MODULE)) | 3259 | if (mod->taints & (1 << TAINT_PROPRIETARY_MODULE)) |
3259 | buf[bx++] = 'P'; | 3260 | buf[bx++] = 'P'; |
3261 | else if (mod->taints & (1 << TAINT_OOT_MODULE)) | ||
3262 | buf[bx++] = 'O'; | ||
3260 | if (mod->taints & (1 << TAINT_FORCED_MODULE)) | 3263 | if (mod->taints & (1 << TAINT_FORCED_MODULE)) |
3261 | buf[bx++] = 'F'; | 3264 | buf[bx++] = 'F'; |
3262 | if (mod->taints & (1 << TAINT_CRAP)) | 3265 | if (mod->taints & (1 << TAINT_CRAP)) |
@@ -3487,50 +3490,3 @@ void module_layout(struct module *mod, | |||
3487 | } | 3490 | } |
3488 | EXPORT_SYMBOL(module_layout); | 3491 | EXPORT_SYMBOL(module_layout); |
3489 | #endif | 3492 | #endif |
3490 | |||
3491 | #ifdef CONFIG_TRACEPOINTS | ||
3492 | void module_update_tracepoints(void) | ||
3493 | { | ||
3494 | struct module *mod; | ||
3495 | |||
3496 | mutex_lock(&module_mutex); | ||
3497 | list_for_each_entry(mod, &modules, list) | ||
3498 | if (!mod->taints) | ||
3499 | tracepoint_update_probe_range(mod->tracepoints_ptrs, | ||
3500 | mod->tracepoints_ptrs + mod->num_tracepoints); | ||
3501 | mutex_unlock(&module_mutex); | ||
3502 | } | ||
3503 | |||
3504 | /* | ||
3505 | * Returns 0 if current not found. | ||
3506 | * Returns 1 if current found. | ||
3507 | */ | ||
3508 | int module_get_iter_tracepoints(struct tracepoint_iter *iter) | ||
3509 | { | ||
3510 | struct module *iter_mod; | ||
3511 | int found = 0; | ||
3512 | |||
3513 | mutex_lock(&module_mutex); | ||
3514 | list_for_each_entry(iter_mod, &modules, list) { | ||
3515 | if (!iter_mod->taints) { | ||
3516 | /* | ||
3517 | * Sorted module list | ||
3518 | */ | ||
3519 | if (iter_mod < iter->module) | ||
3520 | continue; | ||
3521 | else if (iter_mod > iter->module) | ||
3522 | iter->tracepoint = NULL; | ||
3523 | found = tracepoint_get_iter_range(&iter->tracepoint, | ||
3524 | iter_mod->tracepoints_ptrs, | ||
3525 | iter_mod->tracepoints_ptrs | ||
3526 | + iter_mod->num_tracepoints); | ||
3527 | if (found) { | ||
3528 | iter->module = iter_mod; | ||
3529 | break; | ||
3530 | } | ||
3531 | } | ||
3532 | } | ||
3533 | mutex_unlock(&module_mutex); | ||
3534 | return found; | ||
3535 | } | ||
3536 | #endif | ||