The patch titled uml: Fix handling of failed execs of helpers has been removed from the -mm tree. Its filename is uml-fix-handling-of-failed-execs-of-helpers.patch This patch was dropped because it was merged into mainline or a subsystem tree ------------------------------------------------------ Subject: uml: Fix handling of failed execs of helpers From: Jeff Dike <jdike@xxxxxxxxxxx> There were some bugs in handling failures to exec helper programs. errno was passed back from the child with the wrong sign. It was also ignored. In the case where it mattered, the errno from the (successful) read in the parent was used instead. Signed-off-by: Jeff Dike <jdike@xxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxx> --- arch/um/os-Linux/helper.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff -puN arch/um/os-Linux/helper.c~uml-fix-handling-of-failed-execs-of-helpers arch/um/os-Linux/helper.c --- a/arch/um/os-Linux/helper.c~uml-fix-handling-of-failed-execs-of-helpers +++ a/arch/um/os-Linux/helper.c @@ -42,7 +42,7 @@ static int helper_child(void *arg) if(data->pre_exec != NULL) (*data->pre_exec)(data->pre_data); execvp(argv[0], argv); - errval = errno; + errval = -errno; printk("helper_child - execve of '%s' failed - errno = %d\n", argv[0], errno); os_write_file(data->fd, &errval, sizeof(errval)); kill(os_getpid(), SIGKILL); @@ -62,7 +62,7 @@ int run_helper(void (*pre_exec)(void *), stack = *stack_out; else stack = alloc_stack(0, __cant_sleep()); if(stack == 0) - return(-ENOMEM); + return -ENOMEM; ret = os_pipe(fds, 1, 0); if(ret < 0){ @@ -95,16 +95,16 @@ int run_helper(void (*pre_exec)(void *), /* Read the errno value from the child, if the exec failed, or get 0 if * the exec succeeded because the pipe fd was set as close-on-exec. */ n = os_read_file(fds[0], &ret, sizeof(ret)); - if (n < 0) { - printk("run_helper : read on pipe failed, ret = %d\n", -n); - ret = n; - kill(pid, SIGKILL); - CATCH_EINTR(waitpid(pid, NULL, 0)); - } else if(n != 0){ - CATCH_EINTR(n = waitpid(pid, NULL, 0)); - ret = -errno; - } else { + if(n == 0) ret = pid; + else { + if(n < 0){ + printk("run_helper : read on pipe failed, ret = %d\n", + -n); + ret = n; + kill(pid, SIGKILL); + } + CATCH_EINTR(waitpid(pid, NULL, 0)); } out_close: _ Patches currently in -mm which might be from jdike@xxxxxxxxxxx are origin.patch uml-use-mcmodel=kernel-for-x86_64.patch uml-fix-proc-vs-interrupt-context-spinlock-deadlock.patch uml-const-more-data.patch uml-get-rid-of-zone_dma-use.patch uml-fix-missing-x86_64-register-definitions.patch uml-fix-gcov-support.patch uml-use-correct-sigbus-handler.patch uml-add-checkstack-support.patch uml-mark-some-tt-mode-code.patch uml-thread-creation-tidying.patch uml-file-renaming.patch uml-add-an-export.patch uml-fix-sleep-length-bug.patch uml-fix-allocation-size.patch uml-remove-pte_mkexec.patch simplify-update_times-avoid-jiffies-jiffies_64-aliasing-problem-2.patch kill-wall_jiffies.patch const-struct-tty_operations.patch namespaces-utsname-switch-to-using-uts-namespaces.patch introduce-kernel_execve.patch rename-the-provided-execve-functions-to-kernel_execve.patch provide-kernel_execve-on-all-architectures.patch provide-kernel_execve-on-all-architectures-fix.patch remove-the-use-of-_syscallx-macros-in-uml.patch sh64-remove-the-use-of-kernel-syscalls.patch remove-remaining-errno-and-__kernel_syscalls__-references.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html