diff options
Diffstat (limited to 'kernel/kmod.c')
| -rw-r--r-- | kernel/kmod.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/kernel/kmod.c b/kernel/kmod.c index 7e95bedb2bfc..9fcb53a11f87 100644 --- a/kernel/kmod.c +++ b/kernel/kmod.c | |||
| @@ -24,7 +24,6 @@ | |||
| 24 | #include <linux/unistd.h> | 24 | #include <linux/unistd.h> |
| 25 | #include <linux/kmod.h> | 25 | #include <linux/kmod.h> |
| 26 | #include <linux/slab.h> | 26 | #include <linux/slab.h> |
| 27 | #include <linux/mnt_namespace.h> | ||
| 28 | #include <linux/completion.h> | 27 | #include <linux/completion.h> |
| 29 | #include <linux/file.h> | 28 | #include <linux/file.h> |
| 30 | #include <linux/fdtable.h> | 29 | #include <linux/fdtable.h> |
| @@ -38,6 +37,8 @@ | |||
| 38 | #include <linux/suspend.h> | 37 | #include <linux/suspend.h> |
| 39 | #include <asm/uaccess.h> | 38 | #include <asm/uaccess.h> |
| 40 | 39 | ||
| 40 | #include <trace/events/module.h> | ||
| 41 | |||
| 41 | extern int max_threads; | 42 | extern int max_threads; |
| 42 | 43 | ||
| 43 | static struct workqueue_struct *khelper_wq; | 44 | static struct workqueue_struct *khelper_wq; |
| @@ -79,6 +80,10 @@ int __request_module(bool wait, const char *fmt, ...) | |||
| 79 | #define MAX_KMOD_CONCURRENT 50 /* Completely arbitrary value - KAO */ | 80 | #define MAX_KMOD_CONCURRENT 50 /* Completely arbitrary value - KAO */ |
| 80 | static int kmod_loop_msg; | 81 | static int kmod_loop_msg; |
| 81 | 82 | ||
| 83 | ret = security_kernel_module_request(); | ||
| 84 | if (ret) | ||
| 85 | return ret; | ||
| 86 | |||
| 82 | va_start(args, fmt); | 87 | va_start(args, fmt); |
| 83 | ret = vsnprintf(module_name, MODULE_NAME_LEN, fmt, args); | 88 | ret = vsnprintf(module_name, MODULE_NAME_LEN, fmt, args); |
| 84 | va_end(args); | 89 | va_end(args); |
| @@ -109,6 +114,8 @@ int __request_module(bool wait, const char *fmt, ...) | |||
| 109 | return -ENOMEM; | 114 | return -ENOMEM; |
| 110 | } | 115 | } |
| 111 | 116 | ||
| 117 | trace_module_request(module_name, wait, _RET_IP_); | ||
| 118 | |||
| 112 | ret = call_usermodehelper(modprobe_path, argv, envp, | 119 | ret = call_usermodehelper(modprobe_path, argv, envp, |
| 113 | wait ? UMH_WAIT_PROC : UMH_WAIT_EXEC); | 120 | wait ? UMH_WAIT_PROC : UMH_WAIT_EXEC); |
| 114 | atomic_dec(&kmod_concurrent); | 121 | atomic_dec(&kmod_concurrent); |
| @@ -463,6 +470,7 @@ int call_usermodehelper_exec(struct subprocess_info *sub_info, | |||
| 463 | int retval = 0; | 470 | int retval = 0; |
| 464 | 471 | ||
| 465 | BUG_ON(atomic_read(&sub_info->cred->usage) != 1); | 472 | BUG_ON(atomic_read(&sub_info->cred->usage) != 1); |
| 473 | validate_creds(sub_info->cred); | ||
| 466 | 474 | ||
| 467 | helper_lock(); | 475 | helper_lock(); |
| 468 | if (sub_info->path[0] == '\0') | 476 | if (sub_info->path[0] == '\0') |
