summaryrefslogtreecommitdiffstats
path: root/arch/sparc/kernel/traps_32.c
diff options
context:
space:
mode:
authorDmitry V. Levin <ldv@altlinux.org>2018-04-13 16:19:02 +0200
committerEric W. Biederman <ebiederm@xmission.com>2018-04-19 23:39:39 +0200
commit32772c9e2e8b0f9bf4ae0d70eb3c9d8c40d5de22 (patch)
treea980a4fb674320919ded78d43d2277a74aa62db8 /arch/sparc/kernel/traps_32.c
parentsignal/alpha: Document a conflict with SI_USER for SIGFPE (diff)
downloadlinux-32772c9e2e8b0f9bf4ae0d70eb3c9d8c40d5de22.tar.xz
linux-32772c9e2e8b0f9bf4ae0d70eb3c9d8c40d5de22.zip
sparc: fix compat siginfo ABI regression
Starting with commit v4.14-rc1~60^2^2~1, a SIGFPE signal sent via kill results to wrong values in si_pid and si_uid fields of compat siginfo_t. This happens due to FPE_FIXME being defined to 0 for sparc, and at the same time siginfo_layout() introduced by the same commit returns SIL_FAULT for SIGFPE if si_code == SI_USER and FPE_FIXME is defined to 0. Fix this regression by removing FPE_FIXME macro and changing all its users to assign FPE_FLTUNK to si_code instead of FPE_FIXME. Note that FPE_FLTUNK is a new macro introduced by commit 266da65e9156d93e1126e185259a4aae68188d0e. Tested with commit v4.16-11958-g16e205cf42da. This bug was found by strace test suite. In the discussion about FPE_FLTUNK on sparc David Miller said: > Eric, feel free to do something similar on Sparc. Link: https://github.com/strace/strace/issues/21 Fixes: cc731525f26a ("signal: Remove kernel interal si_code magic") Fixes: 2.3.41 Cc: David Miller <davem@davemloft.net> Cc: sparclinux@vger.kernel.org Conceptually-Acked-By: David Miller <davem@davemloft.net> Thanks-to: Anatoly Pugachev <matorola@gmail.com> Signed-off-by: Dmitry V. Levin <ldv@altlinux.org> Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Diffstat (limited to 'arch/sparc/kernel/traps_32.c')
-rw-r--r--arch/sparc/kernel/traps_32.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/sparc/kernel/traps_32.c b/arch/sparc/kernel/traps_32.c
index b1ed763e4787..33cd35bf3dc8 100644
--- a/arch/sparc/kernel/traps_32.c
+++ b/arch/sparc/kernel/traps_32.c
@@ -307,7 +307,7 @@ void do_fpe_trap(struct pt_regs *regs, unsigned long pc, unsigned long npc,
info.si_errno = 0;
info.si_addr = (void __user *)pc;
info.si_trapno = 0;
- info.si_code = FPE_FIXME;
+ info.si_code = FPE_FLTUNK;
if ((fsr & 0x1c000) == (1 << 14)) {
if (fsr & 0x10)
info.si_code = FPE_FLTINV;