--- kernel/kmod.c.orig 2012-03-08 10:26:05.504752023 +0100 +++ kernel/kmod.c 2012-03-08 11:25:05.028661835 +0100 @@ -154,6 +154,15 @@ static int ____call_usermodehelper(void /* We can run anywhere, unlike our parent keventd(). */ set_cpus_allowed_ptr(current, cpu_all_mask); + printk(KERN_EMERG "Unleash the signal...\n"); + + /* + * (1) here we emulate receiving a signal. + * In the original case, a signal should be delivered from outside, + * say, by "kill(-1, SIGKILL)" in busybox. + */ + send_sig(SIGUSR1, current, 0); + /* * Our parent is keventd, which runs with elevated scheduling priority. * Avoid propagating that into the userspace child. @@ -181,6 +190,19 @@ static int ____call_usermodehelper(void commit_creds(new); + /* (2) here we emulate the failure of kernel_execve(). + * In real life, the failure can be due to a memory shortage, + * or something else. + * In our case, it happens when a board reboots - same as (1) above. + */ + retval = kernel_execve(NULL, + (const char *const *)sub_info->argv, + (const char *const *)sub_info->envp); + + printk(KERN_EMERG "x86 is rock-solid!"); + flush_signals(current); + + /* If we survived the test, let's continue so the user should not notice. */ retval = kernel_execve(sub_info->path, (const char *const *)sub_info->argv, (const char *const *)sub_info->envp);