Messages in this thread Patch in this message | | | From | Mike Frysinger <> | Subject | [PATCH] FLAT: fix uninitialized ptr with shared libs | Date | Mon, 22 Jun 2009 15:35:32 -0400 |
| |
From: Bernd Schmidt <bernds_cb1@t-online.de>
The new credentials code broke load_flat_shared_library() as it now uses an uninitialized cred pointer.
Signed-off-by: Bernd Schmidt <bernds_cb1@t-online.de> Signed-off-by: Mike Frysinger <vapier@gentoo.org> Acked-by: David Howells <dhowells@redhat.com> --- should be cleaned up to apply to the master branch
fs/binfmt_flat.c | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/fs/binfmt_flat.c b/fs/binfmt_flat.c index 697f6b5..33283cd 100644 --- a/fs/binfmt_flat.c +++ b/fs/binfmt_flat.c @@ -824,14 +824,23 @@ static int load_flat_shared_library(int id, struct lib_info *libs) /* Open the file up */ bprm.filename = buf; bprm.file = open_exec(bprm.filename); + bprm.cred = NULL; res = PTR_ERR(bprm.file); if (IS_ERR(bprm.file)) return res; + bprm.cred = prepare_exec_creds(); + if (!bprm.cred) + goto out; + res = prepare_binprm(&bprm); if (res <= (unsigned long)-4096) res = load_flat_file(&bprm, libs, id, NULL); + out: + if (bprm.cred) + abort_creds(bprm.cred); + if (bprm.file) { allow_write_access(bprm.file); fput(bprm.file); -- 1.6.3.1
| |