summaryrefslogtreecommitdiffstats
path: root/fs/binfmt_flat.c
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2009-09-12 13:04:37 +0200
committerRussell King <rmk+kernel@arm.linux.org.uk>2009-09-12 13:04:37 +0200
commit87d721ad7a37b7650dd710c88dd5c6a5bf9fe996 (patch)
tree869d633803eb7c429624d3bd16a6117816849763 /fs/binfmt_flat.c
parentMerge branch 'devel-stable' into devel (diff)
parentARM: Fix pfn_valid() for sparse memory (diff)
downloadlinux-87d721ad7a37b7650dd710c88dd5c6a5bf9fe996.tar.xz
linux-87d721ad7a37b7650dd710c88dd5c6a5bf9fe996.zip
Merge branch 'master' into devel
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);
}