x86-32: Fix endless loop when processing signals for kernel tasks
The problem occurs on !CONFIG_VM86 kernels  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:
- work_pending: // start_of_the_loop
- if (!user_mode(regs)) return;
- resume_userspace // TIF_SIGPENDING is still set
- work_pending // so we call work_pending => goto
More information can be found in another LKML thread:
 the problem was also seen on MIPS.
Signed-off-by: Dmitry Adamushko <email@example.com>
Cc: Oleg Nesterov <firstname.lastname@example.org>
Cc: Roland McGrath <email@example.com>
Cc: Andrew Morton <firstname.lastname@example.org>
Signed-off-by: H. Peter Anvin <email@example.com>
1 file changed