[PATCH] sanitize handling of shared descriptor tables in failing execve()
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / fs / binfmt_som.c
index 14c63527c762d8cdc8fc443dec512bd4f34e194f..fdc36bfd6a7beb8d1b63b91520ece0a7d2a347b7 100644 (file)
@@ -194,7 +194,6 @@ load_som_binary(struct linux_binprm * bprm, struct pt_regs * regs)
        unsigned long som_entry;
        struct som_hdr *som_ex;
        struct som_exec_auxhdr *hpuxhdr;
-       struct files_struct *files;
 
        /* Get the exec-header */
        som_ex = (struct som_hdr *) bprm->buf;
@@ -221,15 +220,6 @@ load_som_binary(struct linux_binprm * bprm, struct pt_regs * regs)
                goto out_free;
        }
 
-       files = current->files; /* Refcounted so ok */
-       retval = unshare_files();
-       if (retval < 0)
-               goto out_free;
-       if (files == current->files) {
-               put_files_struct(files);
-               files = NULL;
-       }
-
        retval = get_unused_fd();
        if (retval < 0)
                goto out_free;