aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/kmod.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2011-08-08 08:30:29 -0400
committerTakashi Iwai <tiwai@suse.de>2011-08-08 08:30:29 -0400
commit0a2d31b62dba9b5b92a38c67c9cc42630513662a (patch)
treef755d74ec85248de645e10c45ed1a2ed467530f6 /kernel/kmod.c
parent8039290a91c5dc4414093c086987a5d7738fe2fd (diff)
parentdf944f66784e6d4f2f50739263a4947885d8b6ae (diff)
Merge branch 'fix/kconfig' into for-linus
Diffstat (limited to 'kernel/kmod.c')
-rw-r--r--kernel/kmod.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/kernel/kmod.c b/kernel/kmod.c
index ad6a81c58b44..ddc7644c1305 100644
--- a/kernel/kmod.c
+++ b/kernel/kmod.c
@@ -156,12 +156,6 @@ static int ____call_usermodehelper(void *data)
156 */ 156 */
157 set_user_nice(current, 0); 157 set_user_nice(current, 0);
158 158
159 if (sub_info->init) {
160 retval = sub_info->init(sub_info);
161 if (retval)
162 goto fail;
163 }
164
165 retval = -ENOMEM; 159 retval = -ENOMEM;
166 new = prepare_kernel_cred(current); 160 new = prepare_kernel_cred(current);
167 if (!new) 161 if (!new)
@@ -173,6 +167,14 @@ static int ____call_usermodehelper(void *data)
173 new->cap_inheritable); 167 new->cap_inheritable);
174 spin_unlock(&umh_sysctl_lock); 168 spin_unlock(&umh_sysctl_lock);
175 169
170 if (sub_info->init) {
171 retval = sub_info->init(sub_info, new);
172 if (retval) {
173 abort_creds(new);
174 goto fail;
175 }
176 }
177
176 commit_creds(new); 178 commit_creds(new);
177 179
178 retval = kernel_execve(sub_info->path, 180 retval = kernel_execve(sub_info->path,
@@ -272,7 +274,7 @@ static void __call_usermodehelper(struct work_struct *work)
272 * (used for preventing user land processes from being created after the user 274 * (used for preventing user land processes from being created after the user
273 * land has been frozen during a system-wide hibernation or suspend operation). 275 * land has been frozen during a system-wide hibernation or suspend operation).
274 */ 276 */
275static int usermodehelper_disabled; 277static int usermodehelper_disabled = 1;
276 278
277/* Number of helpers running */ 279/* Number of helpers running */
278static atomic_t running_helpers = ATOMIC_INIT(0); 280static atomic_t running_helpers = ATOMIC_INIT(0);
@@ -388,7 +390,7 @@ EXPORT_SYMBOL(call_usermodehelper_setup);
388 * context in which call_usermodehelper_exec is called. 390 * context in which call_usermodehelper_exec is called.
389 */ 391 */
390void call_usermodehelper_setfns(struct subprocess_info *info, 392void call_usermodehelper_setfns(struct subprocess_info *info,
391 int (*init)(struct subprocess_info *info), 393 int (*init)(struct subprocess_info *info, struct cred *new),
392 void (*cleanup)(struct subprocess_info *info), 394 void (*cleanup)(struct subprocess_info *info),
393 void *data) 395 void *data)
394{ 396{