signal/openrisc: Fix do_unaligned_access to send the proper signal
authorEric W. Biederman <ebiederm@xmission.com>
Tue, 1 Aug 2017 09:16:47 +0000 (04:16 -0500)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 31 May 2018 23:30:07 +0000 (00:30 +0100)
commit883f8db70b4f46532327aa08089f894193d3ed42
tree49f4e42f79cf093d2ace8531d939f25c74fbdfe5
parentab14cc411c8ce8d07e266b0f2ac626f7e35f7f83
signal/openrisc: Fix do_unaligned_access to send the proper signal

commit 500d58300571b6602341b041f97c082a461ef994 upstream.

While reviewing the signal sending on openrisc the do_unaligned_access
function stood out because it is obviously wrong.  A comment about an
si_code set above when actually si_code is never set.  Leading to a
random si_code being sent to userspace in the event of an unaligned
access.

Looking further SIGBUS BUS_ADRALN is the proper pair of signal and
si_code to send for an unaligned access. That is what other
architectures do and what is required by posix.

Given that do_unaligned_access is broken in a way that no one can be
relying on it on openrisc fix the code to just do the right thing.

Fixes: 769a8a96229e ("OpenRISC: Traps")
Cc: Jonas Bonn <jonas@southpole.se>
Cc: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>
Cc: Stafford Horne <shorne@gmail.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: openrisc@lists.librecores.org
Acked-by: Stafford Horne <shorne@gmail.com>
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
arch/openrisc/kernel/traps.c