From 1e9be9238fb88dc0b87a7ffdd48068f944d8626c Mon Sep 17 00:00:00 2001 From: Michael Schmitz Date: Sun, 18 Jul 2021 10:31:42 +1200 Subject: [PATCH] m68k/fpsp040 - save full stack frame before calling fpsp040_die The FPSP040 floating point support code does not know how to handle user space access faults gracefully, and just calls do_exit(SIGSEGV) indirectly on these faults to abort. do_exit() may stop if traced, and needs a full stack frame available to avoid exposing kernel data. Add the current stack frame before calling do_exit() from the fpsp040 user access exception handler. Unwind the stack frame and return to caller once done, in case do_exit() is replaced by force_sig() later on. CC: Eric W. Biederman Signed-off-by: Michael Schmitz --- arch/m68k/fpsp040/skeleton.S | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/arch/m68k/fpsp040/skeleton.S b/arch/m68k/fpsp040/skeleton.S index a8f4161..6c92d38 100644 --- a/arch/m68k/fpsp040/skeleton.S +++ b/arch/m68k/fpsp040/skeleton.S @@ -502,7 +502,17 @@ in_ea: .section .fixup,#alloc,#execinstr .even 1: + + SAVE_ALL_INT + SAVE_SWITCH_STACK jbra fpsp040_die + addql #8,%sp + addql #8,%sp + addql #8,%sp + addql #8,%sp + addql #8,%sp + addql #4,%sp + rts .section __ex_table,#alloc .align 4 -- 2.7.4