linux/arch/mips/kernel
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
..
cpufreq
.gitignore
8250-platform.c
asm-offsets.c MIPS: asm-offset.c: Delete unused irq_cpustat_t struct offsets. 2012-10-11 11:11:20 +02:00
binfmt_elfn32.c
binfmt_elfo32.c
bmips_vec.S
branch.c
cevt-bcm1480.c
cevt-ds1287.c
cevt-gt641xx.c
cevt-r4k.c
cevt-sb1250.c
cevt-smtc.c
cevt-txx9.c
cpu-bugs64.c
cpu-probe.c MIPS: R3000/R3081: Fix CPU detection. 2012-12-05 19:58:54 +01:00
csrc-bcm1480.c
csrc-ioasic.c
csrc-powertv.c
csrc-r4k.c
csrc-sb1250.c
early_printk.c
entry.S MIPS: Fix endless loop when processing signals for kernel tasks 2012-12-05 19:59:00 +01:00
ftrace.c
genex.S
gpio_txx9.c
head.S
i8253.c
i8259.c
irq_cpu.c
irq_txx9.c
irq-gic.c
irq-gt641xx.c
irq-msc01.c
irq-rm7000.c
irq-rm9000.c
irq.c
jump_label.c
kgdb.c mips,kgdb: fix recursive page fault with CONFIG_KPROBES 2012-10-12 06:37:34 -05:00
kprobes.c
linux32.c vfs: define struct filename and have getname() return it 2012-10-12 20:14:55 -04:00
machine_kexec.c
Makefile Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus 2012-10-14 14:39:05 -07:00
mcount.S
mips_ksyms.c
mips_machine.c
mips-mt-fpaff.c
mips-mt.c
module-rela.c MIPS: Fix module.c build for 32 bit 2012-09-28 14:31:02 +09:30
module.c MIPS: Fix module.c build for 32 bit 2012-09-28 14:31:02 +09:30
octeon_switch.S
perf_event_mipsxx.c MIPS: perf: Add perf functionality for BMIPS5000 2012-10-11 11:04:34 +02:00
perf_event.c
proc.c MIPS: proc: Cleanup printing of ASEs. 2012-10-11 11:10:43 +02:00
process.c
prom.c
ptrace32.c
ptrace.c
r4k_fpu.S
r4k_switch.S
r2300_fpu.S
r2300_switch.S
r6000_fpu.S
relocate_kernel.S
reset.c
rtlx.c
scall32-o32.S MIPS: Wire kcmp syscall. 2012-09-26 11:24:28 +02:00
scall64-64.S MIPS: Wire kcmp syscall. 2012-09-26 11:24:28 +02:00
scall64-n32.S MIPS: N32: Fix signalfd4 syscall entry point 2012-12-05 19:58:48 +01:00
scall64-o32.S MIPS: Wire kcmp syscall. 2012-09-26 11:24:28 +02:00
setup.c MIPS: Merge overlapping bootmem ranges 2012-11-23 18:44:37 +01:00
signal32.c
signal_n32.c
signal-common.h
signal.c
smp-bmips.c
smp-cmp.c MIPS: CMP: Fix physical core number calculation logic 2012-10-18 11:45:41 +02:00
smp-mt.c
smp-up.c
smp.c
smtc-asm.S
smtc-proc.c
smtc.c
spinlock_test.c
spram.c
stacktrace.c
sync-r4k.c
syscall.c vfs: define struct filename and have getname() return it 2012-10-12 20:14:55 -04:00
time.c
topology.c
traps.c
unaligned.c
vdso.c
vmlinux.lds.S MIPS: Align swapper_pg_dir to 64K for better TLB Refill code. 2012-10-11 11:02:40 +02:00
vpe.c MIPS: MT: Remove kspd. 2012-10-11 11:14:12 +02:00
watch.c