mn10300/misalignment: Use SIGSEGV SEGV_MAPERR to report a failed user copy
commit8ec68ce24fd19bebabed20e3812d1befbd4be4d4
authorEric W. Biederman <ebiederm@xmission.com>
Tue, 1 Aug 2017 10:02:38 +0000 (1 05:02 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 16 Feb 2018 19:07:00 +0000 (16 20:07 +0100)
treefbcf7f27bfdd3fe991592923b135c0840725635b
parent2433367ce69eb80c90c0a7776f0292081ac8cf2a
mn10300/misalignment: Use SIGSEGV SEGV_MAPERR to report a failed user copy

commit 6ac1dc736b323011a55ecd1fc5897c24c4f77cbd upstream.

Setting si_code to 0 is the same a setting si_code to SI_USER which is definitely
not correct.  With si_code set to SI_USER si_pid and si_uid will be copied to
userspace instead of si_addr.  Which is very wrong.

So fix this by using a sensible si_code (SEGV_MAPERR) for this failure.

Fixes: b920de1b77b7 ("mn10300: add the MN10300/AM33 architecture to the kernel")
Cc: David Howells <dhowells@redhat.com>
Cc: Masakazu Urade <urade.masakazu@jp.panasonic.com>
Cc: Koichi Yasutake <yasutake.koichi@jp.panasonic.com>
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/mn10300/mm/misalignment.c