]> git.baikalelectronics.ru Git - kernel.git/commit
signal/mips: Update (_save|_restore)_fp_context to fail with -EFAULT
authorEric W. Biederman <ebiederm@xmission.com>
Wed, 20 Oct 2021 17:43:51 +0000 (12:43 -0500)
committerEric W. Biederman <ebiederm@xmission.com>
Mon, 25 Oct 2021 20:55:35 +0000 (15:55 -0500)
commite412a08909d8d90d42a0f92409d522731e29be73
tree803ea8fedd4f3acf211a73cf3981a61eddca7037
parente3a82917ca3932c6704c03228b0925c886e28910
signal/mips: Update (_save|_restore)_fp_context to fail with -EFAULT

When an instruction to save or restore a register from the stack fails
in _save_fp_context or _restore_fp_context return with -EFAULT.  This
change was made to r2300_fpu.S[1] but it looks like it got lost with
the introduction of EX2[2].  This is also what the other implementation
of _save_fp_context and _restore_fp_context in r4k_fpu.S does, and
what is needed for the callers to be able to handle the error.

Furthermore calling do_exit(SIGSEGV) from bad_stack is wrong because
it does not terminate the entire process it just terminates a single
thread.

As the changed code was the only caller of arch/mips/kernel/syscall.c:bad_stack
remove the problematic and now unused helper function.

Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: Maciej Rozycki <macro@orcam.me.uk>
Cc: linux-mips@vger.kernel.org
[1] da3f03037a10 ("MIPS: Fix ISA I FP sigcontext access violation handling")
[2] 18aa6b048eb6 ("MIPS: Correct MIPS I FP sigcontext layout")
Cc: stable@vger.kernel.org
Fixes: 18aa6b048eb6 ("MIPS: Correct MIPS I FP sigcontext layout")
Acked-by: Maciej W. Rozycki <macro@orcam.me.uk>
Acked-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Link: https://lkml.kernel.org/r/20211020174406.17889-5-ebiederm@xmission.com
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
arch/mips/kernel/r2300_fpu.S
arch/mips/kernel/syscall.c