projects
/
firefly-linux-kernel-4.4.55.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux
[firefly-linux-kernel-4.4.55.git]
/
fs
/
binfmt_flat.c
diff --git
a/fs/binfmt_flat.c
b/fs/binfmt_flat.c
index 397d3057d336a201b744a6ceadec16eaed651c0e..5979027451b32190f281809519fdd77b76d069a9 100644
(file)
--- a/
fs/binfmt_flat.c
+++ b/
fs/binfmt_flat.c
@@
-15,7
+15,7
@@
* JAN/99 -- coded full program relocation (gerg@snapgear.com)
*/
* JAN/99 -- coded full program relocation (gerg@snapgear.com)
*/
-#include <linux/
module
.h>
+#include <linux/
export
.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/mm.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/mm.h>
@@
-820,6
+820,8
@@
static int load_flat_shared_library(int id, struct lib_info *libs)
int res;
char buf[16];
int res;
char buf[16];
+ memset(&bprm, 0, sizeof(bprm));
+
/* Create the file name */
sprintf(buf, "/lib/lib%d.so", id);
/* Create the file name */
sprintf(buf, "/lib/lib%d.so", id);
@@
-835,6
+837,12
@@
static int load_flat_shared_library(int id, struct lib_info *libs)
if (!bprm.cred)
goto out;
if (!bprm.cred)
goto out;
+ /* We don't really care about recalculating credentials at this point
+ * as we're past the point of no return and are dealing with shared
+ * libraries.
+ */
+ bprm.cred_prepared = 1;
+
res = prepare_binprm(&bprm);
if (!IS_ERR_VALUE(res))
res = prepare_binprm(&bprm);
if (!IS_ERR_VALUE(res))
@@
-894,7
+902,6
@@
static int load_flat_binary(struct linux_binprm * bprm, struct pt_regs * regs)
libinfo.lib_list[j].start_data:UNLOADED_LIB;
install_exec_creds(bprm);
libinfo.lib_list[j].start_data:UNLOADED_LIB;
install_exec_creds(bprm);
- current->flags &= ~PF_FORKNOEXEC;
set_binfmt(&flat_format);
set_binfmt(&flat_format);
@@
-942,7
+949,8
@@
static int load_flat_binary(struct linux_binprm * bprm, struct pt_regs * regs)
static int __init init_flat_binfmt(void)
{
static int __init init_flat_binfmt(void)
{
- return register_binfmt(&flat_format);
+ register_binfmt(&flat_format);
+ return 0;
}
/****************************************************************************/
}
/****************************************************************************/