signal/ia64: Replace FPE_FIXME with FPE_FLTUNK
authorEric W. Biederman <ebiederm@xmission.com>
Tue, 17 Apr 2018 20:45:30 +0000 (15:45 -0500)
committerEric W. Biederman <ebiederm@xmission.com>
Wed, 25 Apr 2018 15:40:55 +0000 (10:40 -0500)
Using an si_code of 0 that aliases with SI_USER is clearly the wrong
thing todo, and causes problems in interesting ways.

The newly defined FPE_FLTUNK semantically appears to fit the bill so
use it instead.

Given recent experience in this area odds are it will not
break anything.  Fixing it removes a hazard to kernel maintenance.

Cc: Tony Luck <tony.luck@intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: linux-ia64@vger.kernel.org
Fixes: 987159266c45 ("Linux version 2.3.48")
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
arch/ia64/include/uapi/asm/siginfo.h
arch/ia64/kernel/traps.c

index 5aa454e..52b5af4 100644 (file)
 #define __ISR_VALID_BIT        0
 #define __ISR_VALID    (1 << __ISR_VALID_BIT)
 
-/*
- * SIGFPE si_codes
- */
-#ifdef __KERNEL__
-#define FPE_FIXME      0       /* Broken dup of SI_USER */
-#endif /* __KERNEL__ */
-
 #endif /* _UAPI_ASM_IA64_SIGINFO_H */
index 972873e..c6f4932 100644 (file)
@@ -353,7 +353,7 @@ handle_fpu_swa (int fp_fault, struct pt_regs *regs, unsigned long isr)
                        clear_siginfo(&siginfo);
                        siginfo.si_signo = SIGFPE;
                        siginfo.si_errno = 0;
-                       siginfo.si_code = FPE_FIXME;    /* default code */
+                       siginfo.si_code = FPE_FLTUNK;   /* default code */
                        siginfo.si_addr = (void __user *) (regs->cr_iip + ia64_psr(regs)->ri);
                        if (isr & 0x11) {
                                siginfo.si_code = FPE_FLTINV;
@@ -380,7 +380,7 @@ handle_fpu_swa (int fp_fault, struct pt_regs *regs, unsigned long isr)
                        clear_siginfo(&siginfo);
                        siginfo.si_signo = SIGFPE;
                        siginfo.si_errno = 0;
-                       siginfo.si_code = FPE_FIXME;    /* default code */
+                       siginfo.si_code = FPE_FLTUNK;   /* default code */
                        siginfo.si_addr = (void __user *) (regs->cr_iip + ia64_psr(regs)->ri);
                        if (isr & 0x880) {
                                siginfo.si_code = FPE_FLTOVF;