From: Philipp R. <pr...@pa...> - 2000-11-23 13:30:30
|
On Thu, Nov 23, 2000 at 01:11:20PM +0000, David Woodhouse wrote: > > pr...@pa... said: > > Write portable code and it won't. > > insmod(8) was what triggered us to do it. > > > pr...@pa... said: > > If you don't see your process's exit status your test environment is > > broken. if the process doesn't die with SEGV there's another kernel > > bug. > > You don't see the exit status of insmod when request_module() fails, do you? exec_usermodehelper is broken. not broken as in "has bugs", but broken as in "has a fundamentlly broken design". this isn't exactly news. nevertheless, there's an obvious fix (not sure whether WIF* are defined in kernelspace, but this shouldn't _be_ in kernelspace in the first place) @@ -167,6 +167,7 @@ { int pid; int waitpid_result; + int waitpid_status; sigset_t tmpsig; int i; static atomic_t kmod_concurrent = ATOMIC_INIT(0); @@ -215,7 +216,7 @@ recalc_sigpending(current); spin_unlock_irq(¤t->sigmask_lock); - waitpid_result = waitpid(pid, NULL, __WCLONE); + waitpid_result = waitpid(pid, &waitpid_status, __WCLONE); atomic_dec(&kmod_concurrent); /* Allow signals again.. */ @@ -228,6 +229,12 @@ printk(KERN_ERR "request_module[%s]: waitpid(%d,...) failed, errno %d\n", module_name, pid, -waitpid_result); } + + if (!WIFSIGNALED(waitpid_status)) { + printk(KERN_ERR "request_module[%s]: modprobe exited with signal %d\n", + module_name, WTERMSIG(waitpid_status)); + } + return 0; } #endif /* CONFIG_KMOD */ |