projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9e5cf0c
)
flat: fix uninitialized ptr with shared libs
author
Linus Torvalds
<
[email protected]
>
Thu, 6 Aug 2009 22:09:34 +0000
(15:09 -0700)
committer
Linus Torvalds
<
[email protected]
>
Fri, 7 Aug 2009 17:39:57 +0000
(10:39 -0700)
The new credentials code broke load_flat_shared_library() as it now uses
an uninitialized cred pointer.
Reported-by: Bernd Schmidt <
[email protected]
>
Tested-by: Bernd Schmidt <
[email protected]
>
Cc: Mike Frysinger <
[email protected]
>
Cc: David Howells <
[email protected]
>
Cc: <
[email protected]
>
Signed-off-by: Andrew Morton <
[email protected]
>
Signed-off-by: Linus Torvalds <
[email protected]
>
fs/binfmt_flat.c
patch
|
blob
|
history
diff --git
a/fs/binfmt_flat.c
b/fs/binfmt_flat.c
index 697f6b5f13139ac5ea95a3f7456687299f26775e..e92f229e3c6e9d994d61f5581625c35c2bde6bd7 100644
(file)
--- 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);
}