public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Fix for shared flat binary format in 2.6.30
@ 2009-06-22 10:36 Bernd Schmidt
  2009-06-22 18:44 ` Linus Torvalds
  0 siblings, 1 reply; 13+ messages in thread
From: Bernd Schmidt @ 2009-06-22 10:36 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Linux Kernel Mailing List, Blackfin Architecture Team,
	David Howells, stable

[-- Attachment #1: Type: text/plain, Size: 513 bytes --]

This fixes a crash in 2.6.30 with shared flat binaries.  prepare_binfmt 
now requires a cred pointer to be set up, which isn't done in binfmt_flat.c.

Signed-off-by: Bernd Schmidt <bernds_cb1@t-online.de>
Acked-by: David Howells <dhowells@redhat.com>
-- 
This footer brought to you by insane German lawmakers.
Analog Devices GmbH      Wilhelm-Wagenfeld-Str. 6      80807 Muenchen
Sitz der Gesellschaft Muenchen, Registergericht Muenchen HRB 40368
Geschaeftsfuehrer Thomas Wessel, William A. Martin, Margaret Seif

[-- Attachment #2: cred-flat.diff --]
[-- Type: text/plain, Size: 723 bytes --]

Index: fs/binfmt_flat.c
===================================================================
--- fs/binfmt_flat.c	(revision 6766)
+++ fs/binfmt_flat.c	(working copy)
@@ -853,14 +853,23 @@ static int load_flat_shared_library(int 
 	/* 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);

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2009-06-29 23:54 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-22 10:36 Fix for shared flat binary format in 2.6.30 Bernd Schmidt
2009-06-22 18:44 ` Linus Torvalds
2009-06-22 18:56   ` Linus Torvalds
2009-06-22 19:35   ` [PATCH] FLAT: fix uninitialized ptr with shared libs Mike Frysinger
2009-06-22 20:48     ` Linus Torvalds
2009-06-22 21:00       ` [Uclinux-dist-devel] " Mike Frysinger
2009-06-23 10:14       ` Bernd Schmidt
2009-06-29 23:44         ` [stable] " Greg KH
2009-06-22 20:39   ` Fix for shared flat binary format in 2.6.30 John Stoffel
2009-06-22 21:06     ` Linus Torvalds
2009-06-23  1:59       ` John Stoffel
2009-06-23  2:44         ` Linus Torvalds
2009-06-25  7:12     ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox