Skip to contentSkip to conversation

fix load_elf_binary error path on unshare_files error

PATCH New Chris Wright 1 participant 1 message Apr 8, 2004

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix load_elf_binary error path on unshare_files error

Make sure to return proper retval on unshare_files() error in load_elf_binary. Patch against 2.6.5.

Error noted by Kirill Korotaev <[email protected]>.

===== fs/binfmt_elf.c 1.69 vs edited =====

fs/binfmt_elf.c +2 -1
@@ -509,7 +509,8 @@
 		goto out_free_ph;
 
 	files = current->files;		/* Refcounted so ok */
-	if(unshare_files() < 0)
+	retval = unshare_files();
+	if (retval < 0)
 		goto out_free_ph;
 	if (files == current->files) {
 		put_files_struct(files);
Signature · 1 line
Linux Security Modules     http://lsm.immunix.org     http://lsm.bkbits.net