diff options
| author | Paul Mundt <lethal@linux-sh.org> | 2011-06-24 17:16:40 +0900 |
|---|---|---|
| committer | Paul Mundt <lethal@linux-sh.org> | 2011-06-24 17:16:40 +0900 |
| commit | 20733d59d5763ecd96276f868c1f39e677b3b4e2 (patch) | |
| tree | 89177676a2a45afa97595ce1827630aa131c51e2 /kernel/kmod.c | |
| parent | 75e1b6a84f7e2186e843da94751b6d175caf9209 (diff) | |
| parent | 17e8c4e1ebf139743e3830439fa65fd906af4a43 (diff) | |
Merge branch 'fbdev/stable-updates'
Diffstat (limited to 'kernel/kmod.c')
| -rw-r--r-- | kernel/kmod.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/kernel/kmod.c b/kernel/kmod.c index ad6a81c58b4..47613dfb7b2 100644 --- a/kernel/kmod.c +++ b/kernel/kmod.c @@ -156,12 +156,6 @@ static int ____call_usermodehelper(void *data) */ set_user_nice(current, 0); - if (sub_info->init) { - retval = sub_info->init(sub_info); - if (retval) - goto fail; - } - retval = -ENOMEM; new = prepare_kernel_cred(current); if (!new) @@ -173,6 +167,14 @@ static int ____call_usermodehelper(void *data) new->cap_inheritable); spin_unlock(&umh_sysctl_lock); + if (sub_info->init) { + retval = sub_info->init(sub_info, new); + if (retval) { + abort_creds(new); + goto fail; + } + } + commit_creds(new); retval = kernel_execve(sub_info->path, @@ -388,7 +390,7 @@ EXPORT_SYMBOL(call_usermodehelper_setup); * context in which call_usermodehelper_exec is called. */ void call_usermodehelper_setfns(struct subprocess_info *info, - int (*init)(struct subprocess_info *info), + int (*init)(struct subprocess_info *info, struct cred *new), void (*cleanup)(struct subprocess_info *info), void *data) { |
