linux/arch/um/kernel
Eric W. Biederman 530621b79f signal/um: More carefully relay signals in relay_signal.
There is a bug in relay signal.  It assumes that when a signal is
relayed the signal never uses a signal independent si_code, such
as SI_USER, SI_KERNEL, SI_QUEUE, ... SI_SIGIO etc.  In practice
siginfo was assuming it was relaying a signal with the SIL_FAULT
layout.  As that is the common cases for the signals it supported
that is a reasonable assumption.

Further user mode linux must be very careful when relaying different
kinds of signals to prevent an information leak.  This means simply
increasing the kinds of signals that are handled in relay_signal
is non-trivial.

Therefore use siginfo_layout and force_sig_fault to simplify
the signal relaying in relay_signal.

By taking advantage of the fact that user mode linux only works
on x86 and x86_64 we can assume that si_trapno can be ignored,
and that si_errno is always zero.

For the signals SIGLL, SIGFPE, SIGSEGV, SIGBUS, and SIGTRAP the only
fault handler I know of that sets si_errno is SIGTRAP TRAP_HWBKPT on a
few oddball architectures.  Those architectures have been modified to
use force_sig_ptrace_errno_trap.

Similarly only a few architectures set __ARCH_SI_TRAPNO.

At the point uml supports those architectures again these additional
cases can be examined and supported if desired in relay_signal.

Cc: Jeff Dike <jdike@addtoit.com>
Cc: Richard Weinberger <richard@nod.at>
Cc: Anton Ivanov <anton.ivanov@kot-begemot.co.uk>
Cc: Martin Pärtel <martin.partel@gmail.com>
Cc: user-mode-linux-devel@lists.sourceforge.net
Cc: linux-um@lists.infradead.org
Fixes: d3c1cfcdb4 ("um: pass siginfo to guest process")
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
2018-04-28 08:46:49 -05:00
..
skas
Makefile
asm-offsets.c
config.c.in
dyn.lds.S Construct init thread stack in the linker script rather than by union 2018-01-09 23:21:02 +00:00
early_printk.c
exec.c
exitcode.c
gmon_syms.c
gprof_syms.c
initrd.c
irq.c um: Add missing EXPORT for free_irq_by_fd() 2018-02-19 19:38:51 +01:00
kmsg_dump.c
ksyms.c
maccess.c
mem.c
physmem.c
process.c
ptrace.c signal/um: Use force_sig_fault where appropriate 2018-04-25 10:44:11 -05:00
reboot.c
sigio.c
signal.c
stacktrace.c
syscall.c mm: add ksys_mmap_pgoff() helper; remove in-kernel calls to sys_mmap_pgoff() 2018-04-02 20:16:11 +02:00
sysrq.c
time.c um: time: Use timespec64 for persistent clock 2018-02-19 19:38:51 +01:00
tlb.c
trap.c signal/um: More carefully relay signals in relay_signal. 2018-04-28 08:46:49 -05:00
um_arch.c Construct init thread stack in the linker script rather than by union 2018-01-09 23:21:02 +00:00
umid.c
uml.lds.S Construct init thread stack in the linker script rather than by union 2018-01-09 23:21:02 +00:00
vmlinux.lds.S