aboutsummaryrefslogtreecommitdiffstats
path: root/fs/binfmt_flat.c
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2009-08-15 13:00:02 +0900
committerPaul Mundt <lethal@linux-sh.org>2009-08-15 13:00:02 +0900
commit4b6b987969b076298485697bfb0d0e35502642a3 (patch)
treea8f5ebd6a0b9efbe30272012d759669b0c5ddc13 /fs/binfmt_flat.c
parentsh: Runtime PM pdev hwblk - Solution Engine 7724 (diff)
parentMerge branch 'sh/stable-updates' (diff)
downloadlinux-dev-4b6b987969b076298485697bfb0d0e35502642a3.tar.xz
linux-dev-4b6b987969b076298485697bfb0d0e35502642a3.zip
Merge branch 'master' into sh/hwblk
Diffstat (limited to 'fs/binfmt_flat.c')
-rw-r--r--fs/binfmt_flat.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/fs/binfmt_flat.c b/fs/binfmt_flat.c
index 697f6b5f1313..e92f229e3c6e 100644
--- a/fs/binfmt_flat.c
+++ b/fs/binfmt_flat.c
@@ -828,15 +828,22 @@ static int load_flat_shared_library(int id, struct lib_info *libs)
if (IS_ERR(bprm.file))
return res;
+ bprm.cred = prepare_exec_creds();
+ res = -ENOMEM;
+ if (!bprm.cred)
+ goto out;
+
res = prepare_binprm(&bprm);
if (res <= (unsigned long)-4096)
res = load_flat_file(&bprm, libs, id, NULL);
- if (bprm.file) {
- allow_write_access(bprm.file);
- fput(bprm.file);
- bprm.file = NULL;
- }
+
+ abort_creds(bprm.cred);
+
+out:
+ allow_write_access(bprm.file);
+ fput(bprm.file);
+
return(res);
}