signal/xtensa: Consistenly use SIGBUS in do_unaligned_user
authorEric W. Biederman <ebiederm@xmission.com>
Fri, 20 Apr 2018 14:14:56 +0000 (09:14 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 3 Jul 2018 09:24:47 +0000 (11:24 +0200)
commit 7de712ccc096b81d23cc0a941cd9b8cb3956605d upstream.

While working on changing this code to use force_sig_fault I
discovered that do_unaliged_user is sets si_signo to SIGBUS and passes
SIGSEGV to force_sig_info.  Which is just b0rked.

The code is reporting a SIGBUS error so replace the SIGSEGV with SIGBUS.

Cc: Chris Zankel <chris@zankel.net>
Cc: Max Filippov <jcmvbkbc@gmail.com>
Cc: linux-xtensa@linux-xtensa.org
Cc: stable@vger.kernel.org
Acked-by: Max Filippov <jcmvbkbc@gmail.com>
Fixes: 5a0015d62668 ("[PATCH] xtensa: Architecture support for Tensilica Xtensa Part 3")
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/xtensa/kernel/traps.c

index bae697a06a984536bc51ce21cb3e402d5cfbd065..2986bc88a18e77fb1158037be662002ad94e9ec5 100644 (file)
@@ -336,7 +336,7 @@ do_unaligned_user (struct pt_regs *regs)
        info.si_errno = 0;
        info.si_code = BUS_ADRALN;
        info.si_addr = (void *) regs->excvaddr;
-       force_sig_info(SIGSEGV, &info, current);
+       force_sig_info(SIGBUS, &info, current);
 
 }
 #endif