Commit 178036e3 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] fix load_elf_binary error path on unshare_files error

From: Chris Wright <chrisw@osdl.org>

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

Error noted by Kirill Korotaev <kirillx@7ka.mipt.ru>.
parent 8cc89540
...@@ -522,7 +522,8 @@ static int load_elf_binary(struct linux_binprm * bprm, struct pt_regs * regs) ...@@ -522,7 +522,8 @@ static int load_elf_binary(struct linux_binprm * bprm, struct pt_regs * regs)
goto out_free_ph; goto out_free_ph;
files = current->files; /* Refcounted so ok */ files = current->files; /* Refcounted so ok */
if(unshare_files() < 0) retval = unshare_files();
if (retval < 0)
goto out_free_ph; goto out_free_ph;
if (files == current->files) { if (files == current->files) {
put_files_struct(files); put_files_struct(files);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment