signal: Don't use structure initializers for struct siginfo
authorEric W. Biederman <ebiederm@xmission.com>
Mon, 22 Jan 2018 20:58:57 +0000 (14:58 -0600)
committerEric W. Biederman <ebiederm@xmission.com>
Tue, 23 Jan 2018 01:07:08 +0000 (19:07 -0600)
commit5f74972ce69fdc6473f74253283408af75a3be15
tree0353784ed4e95a7a32e159ba9b66d1f697317680
parent66e0f26315ce7dd3f4efdbdee63f30dac643763f
signal: Don't use structure initializers for struct siginfo

The siginfo structure has all manners of holes with the result that a
structure initializer is not guaranteed to initialize all of the bits.
As we have to copy the structure to userspace don't even try to use
a structure initializer.  Instead use clear_siginfo followed by initializing
selected fields.  This gives a guarantee that uninitialized kernel memory
is not copied to userspace.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
arch/arc/kernel/traps.c
arch/arm64/kernel/debug-monitors.c
arch/arm64/kernel/ptrace.c
arch/m68k/mm/fault.c
arch/mips/kernel/traps.c
arch/tile/kernel/single_step.c
arch/tile/kernel/traps.c
arch/tile/kernel/unaligned.c
kernel/signal.c