Title: [6821] trunk/fs/binfmt_flat.c: Fix a crash with shared flat in 2.6.30.
Revision
6821
Author
bernds
Date
2009-06-22 06:40:06 -0500 (Mon, 22 Jun 2009)

Log Message

Fix a crash with shared flat in 2.6.30.

prepare_binprm now requires a cred pointer to be set up, which isn't done in
binfmt_flat.c.

Modified Paths

Diff

Modified: trunk/fs/binfmt_flat.c (6820 => 6821)


--- trunk/fs/binfmt_flat.c	2009-06-22 06:14:33 UTC (rev 6820)
+++ trunk/fs/binfmt_flat.c	2009-06-22 11:40:06 UTC (rev 6821)
@@ -853,14 +853,23 @@
 	/* 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, NULL);
+out:
+	if (bprm.cred)
+		abort_creds(bprm.cred);
+
 	if (bprm.file) {
 		allow_write_access(bprm.file);
 		fput(bprm.file);
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
https://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits

Reply via email to