Dmitry Adamushko c90e6fbb22 MIPS: Fix endless loop when processing signals for kernel tasks
The problem occurs [1] when a kernel-mode task returns from a system
call with a pending signal.

A real-life scenario is a child of 'khelper' returning from a failed
kernel_execve() in ____call_usermodehelper() [ kernel/kmod.c ].
kernel_execve() fails due to a pending SIGKILL, which is the result of
"kill -9 -1" (at least, busybox's init does it upon reboot).

The loop is as follows:

* syscall_exit_work:
 - work_pending:            // start_of_the_loop
 - work_notifysig:
   - do_notify_resume()
     - do_signal()
       - if (!user_mode(regs)) return;
 - resume_userspace         // TIF_SIGPENDING is still set
 - work_pending             // so we call work_pending => goto
                            // start_of_the_loop

More information can be found in another LKML thread:
http://www.serverphorums.com/read.php?12,457826

[1] The problem was also reproduced on !CONFIG_VM86 x86, and the
following fix was accepted.

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=29a2e2836ff9ea65a603c89df217f4198973a74f

Signed-off-by: Dmitry Adamushko <dmitry.adamushko@gmail.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/3571/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2012-12-05 19:59:00 +01:00
..
2011-12-07 22:03:45 +00:00
2011-12-07 22:03:45 +00:00
2011-12-07 22:03:45 +00:00
2012-09-13 15:43:49 -05:00
2011-12-07 22:03:45 +00:00
2011-12-07 22:03:45 +00:00
2011-12-07 22:03:45 +00:00
2012-03-28 18:30:02 +01:00
2012-03-28 18:30:02 +01:00
2012-04-08 21:48:52 +02:00
2012-09-28 14:31:02 +09:30
2012-10-11 11:10:43 +02:00
2012-03-28 18:30:02 +01:00
2012-03-28 18:30:02 +01:00
2012-03-28 18:30:02 +01:00
2012-09-26 11:24:28 +02:00
2012-09-26 11:24:28 +02:00
2012-09-26 11:24:28 +02:00
2012-11-23 18:44:37 +01:00
2012-03-28 18:30:02 +01:00
2012-03-28 18:30:02 +01:00
2009-06-24 18:34:40 +01:00
2012-07-23 13:57:04 +01:00
2012-03-28 18:30:02 +01:00
2012-03-23 16:58:42 -07:00
2012-10-11 11:14:12 +02:00