linux/arch/mips
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
..
alchemy MIPS: Alchemy: Merge PB1100/1500 support into DB1000 code. 2012-10-11 11:11:20 +02:00
ar7
ath79 MIPS: ath79: Fix CPU/DDR frequency calculation for SRIF PLLs 2012-10-01 11:37:15 +02:00
bcm47xx
bcm63xx Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus 2012-10-09 16:08:04 +09:00
boot MIPS: Alchemy: Single kernel for DB1200/1300/1550 2012-10-11 11:11:20 +02:00
cavium-octeon MIPS: Remove irqflags.h dependency from bitops.h 2012-11-09 10:59:10 +01:00
cobalt
configs MIPS: Alchemy: Merge PB1100/1500 support into DB1000 code. 2012-10-11 11:11:20 +02:00
dec
emma
fw mips, arc: fix build failure 2012-11-16 14:33:04 -08:00
include MIPS: Avoid mcheck by flushing page range in huge_ptep_set_access_flags() 2012-12-04 16:57:54 +01:00
jazz
jz4740 MIPS: JZ4740: Forward declare struct uart_port in header. 2012-10-17 17:00:50 +02:00
kernel MIPS: Fix endless loop when processing signals for kernel tasks 2012-12-05 19:59:00 +01:00
lantiq Merge branch 'master' of git://dev.phrozen.org/mips-next into mips-for-linux-next 2012-10-05 15:56:28 +02:00
lasat
lib MIPS: Fix crash that occurs when function tracing is enabled 2012-11-23 18:44:38 +01:00
loongson
loongson1
math-emu
mm MIPS: Avoid mcheck by flushing page range in huge_ptep_set_access_flags() 2012-12-04 16:57:54 +01:00
mti-malta MIPS: Malta: Fix interupt number of CBUS UART. 2012-11-13 14:50:15 +01:00
mti-sead3 MIPS: Add core files for MIPS SEAD-3 development platform. 2012-09-13 15:43:46 -05:00
netlogic
oprofile
pci MIPS: Malta: Fix section mismatch. 2012-10-11 11:14:12 +02:00
pmc-sierra
pnx833x
pnx8550
power
powertv
rb532
sgi-ip22
sgi-ip27
sgi-ip32
sibyte
sni MIPS: SNI: Switch RM400 serial to SCCNXP driver 2012-10-11 11:14:13 +02:00
txx9
vr41xx
wrppmc
Kbuild
Kbuild.platforms Merge branch 'ralf-3.7' of git://git.linux-mips.org/pub/scm/sjhill/linux-sjhill into mips-for-linux-next 2012-09-28 16:29:55 +02:00
Kconfig Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus 2012-10-14 14:39:05 -07:00
Kconfig.debug
Makefile kbuild: Fix gcc -x syntax 2012-10-03 09:03:24 +02:00