signal: Reduce copy_siginfo_to_user to just copy_to_user
authorEric W. Biederman <ebiederm@xmission.com>
Sat, 14 Apr 2018 18:03:25 +0000 (13:03 -0500)
committerEric W. Biederman <ebiederm@xmission.com>
Wed, 25 Apr 2018 15:40:52 +0000 (10:40 -0500)
commitc999b933faa5e281e3af2e110eccaf91698b0a81
tree9583f38fc3bb11d91b6df5d01b982c993e705051
parent3eb0f5193b497083391aa05d35210d5645211eef
signal: Reduce copy_siginfo_to_user to just copy_to_user

Now that every instance of struct siginfo is now initialized it is no
longer necessary to copy struct siginfo piece by piece to userspace
but instead the entire structure can be copied.

As well as making the code simpler and more efficient this means that
copy_sinfo_to_user no longer cares which union member of struct
siginfo is in use.

In practice this means that all 32bit architectures that define
FPE_FIXME will handle properly send SI_USER when kill(SIGFPE) is sent.
While still performing their historic architectural brokenness when 0
is used a floating pointer signal.  This matches the current behavior
of 64bit architectures that define FPE_FIXME who get lucky and an
overloaded SI_USER has continuted to work through copy_siginfo_to_user
because the 8 byte si_addr occupies the same bytes in struct siginfo
as the 4 byte si_pid and the 4 byte si_uid.

Problematic architectures still need to fix their ABI so that signalfd
and 32bit compat code will work properly.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
kernel/signal.c