Commit e2bd64d9 authored by Eric W. Biederman's avatar Eric W. Biederman

signal/alpha: Document a conflict with SI_USER for SIGTRAP

Setting si_code to __SI_FAULT results in a userspace seeing
an si_code of 0.  This is the same si_code as SI_USER.  Posix
and common sense requires that SI_USER not be a signal specific
si_code.  As such this use of 0 for the si_code is a pretty
horribly broken ABI.

Given that alpha is on it's last legs I don't know that it is worth
fixing this, but it is worth documenting what is going on so that
no one decides to copy this bad decision.

This was introduced during the 2.5 development cycle so this
mess has had a long time for people to be able to depend upon it.

v2: Added FPE_FIXME for alpha as Helge Deller <deller@gmx.de> pointed out
    with his alternate patch one of the cases is SIGFPE not SIGTRAP.

Cc: Helge Deller <deller@gmx.de>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Matt Turner <mattst88@gmail.com>
Cc: linux-alpha@vger.kernel.org
Acked-by: default avatarRichard Henderson <rth@twiddle.net>
History Tree: https://git.kernel.org/pub/scm/linux/kernel/git/tglx/history.git
Ref: 0a635c7a ("Fill in siginfo_t.")
Signed-off-by: default avatar"Eric W. Biederman" <ebiederm@xmission.com>
parent 5771a8c0
...@@ -6,4 +6,18 @@ ...@@ -6,4 +6,18 @@
#include <asm-generic/siginfo.h> #include <asm-generic/siginfo.h>
/*
* SIGFPE si_codes
*/
#ifdef __KERNEL__
#define FPE_FIXME (__SI_FAULT|0) /* Broken dup of SI_USER */
#endif /* __KERNEL__ */
/*
* SIGTRAP si_codes
*/
#ifdef __KERNEL__
#define TRAP_FIXME (__SI_FAULT|0) /* Broken dup of SI_USER */
#endif /* __KERNEL__ */
#endif #endif
...@@ -278,7 +278,7 @@ do_entIF(unsigned long type, struct pt_regs *regs) ...@@ -278,7 +278,7 @@ do_entIF(unsigned long type, struct pt_regs *regs)
case 1: /* bugcheck */ case 1: /* bugcheck */
info.si_signo = SIGTRAP; info.si_signo = SIGTRAP;
info.si_errno = 0; info.si_errno = 0;
info.si_code = __SI_FAULT; info.si_code = TRAP_FIXME;
info.si_addr = (void __user *) regs->pc; info.si_addr = (void __user *) regs->pc;
info.si_trapno = 0; info.si_trapno = 0;
send_sig_info(SIGTRAP, &info, current); send_sig_info(SIGTRAP, &info, current);
...@@ -318,7 +318,7 @@ do_entIF(unsigned long type, struct pt_regs *regs) ...@@ -318,7 +318,7 @@ do_entIF(unsigned long type, struct pt_regs *regs)
break; break;
case GEN_ROPRAND: case GEN_ROPRAND:
signo = SIGFPE; signo = SIGFPE;
code = __SI_FAULT; code = FPE_FIXME;
break; break;
case GEN_DECOVF: case GEN_DECOVF:
...@@ -340,7 +340,7 @@ do_entIF(unsigned long type, struct pt_regs *regs) ...@@ -340,7 +340,7 @@ do_entIF(unsigned long type, struct pt_regs *regs)
case GEN_SUBRNG7: case GEN_SUBRNG7:
default: default:
signo = SIGTRAP; signo = SIGTRAP;
code = __SI_FAULT; code = TRAP_FIXME;
break; break;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment