signal/ia64: Use the generic force_sigsegv in setup_frame
authorEric W. Biederman <ebiederm@xmission.com>
Mon, 16 Apr 2018 18:55:06 +0000 (13:55 -0500)
committerEric W. Biederman <ebiederm@xmission.com>
Thu, 27 Sep 2018 19:57:52 +0000 (21:57 +0200)
commit8b9c6b28312cc51a87055e292b11c5aa28f0c935
tree72d2fb5a392dd97c11799884f8982ba44943588d
parent795a83714526754a2b8089a0533bfef24287bcb9
signal/ia64: Use the generic force_sigsegv in setup_frame

The ia64 handling of failure to setup a signal frame has been trying
to set overlapping fields in struct siginfo since 2.3.43.  The si_pid
and si_uid fields are stomped when the si_addr field is set.  The
si_code of SI_KERNEL indicates that si_pid and si_uid should be valid,
and that si_addr does not exist.

Being at odds with the definition of SI_KERNEL and with nothing to
indicate that this was a signal frame setup failure there is no way
for userspace to know that si_addr was filled out instead.

In practice failure to setup a signal frame is rare, and si_pid and
si_uid are always set to 0 when si_code is SI_KERNEL so I expect no
one has looked closely enough before to see this weirdness.  Further
the only difference between force_sigsegv_info and the generic
force_sigsegv other than the return code is that force_sigsegv_info
stomps the si_uid and si_pid fields.

Remove the bug and simplify the code by using force_sigsegv in this
case just like other architectures.

Fixes: 2.3.43
Cc: Tony Luck <tony.luck@intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: linux-ia64@vger.kernel.org
Acked-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
arch/ia64/kernel/signal.c