Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

signal/alpha: Replace TRAP_FIXME with TRAP_UNK

Using an si_code of 0 that aliases with SI_USER is clearly the wrong
thing to do, and causes problems in interesting ways.

For it really is not clear to me if using TRAP_UNK bugcheck or
the default case of gentrap is really the best way to handle
things. There is certainly enough information that that a more
specific si_code could potentially be used. That said TRAP_UNK
is definitely an improvement over 0 as it removes the ambiguiuty
of what si_code of 0 with SIGTRAP means on alpha.

Recent history suggests no actually cares about crazy corner cases of
the kernel behavior like this so I don't expect any regressions from
changing this. However if something does happen this change is easy
to revert.

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
Fixes: 0a635c7a84cf ("Fill in siginfo_t.")
History Tree: https://git.kernel.org/pub/scm/linux/kernel/git/tglx/history.git
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>

+2 -9
-7
arch/alpha/include/uapi/asm/siginfo.h
··· 7 7 8 8 #include <asm-generic/siginfo.h> 9 9 10 - /* 11 - * SIGTRAP si_codes 12 - */ 13 - #ifdef __KERNEL__ 14 - #define TRAP_FIXME 0 /* Broken dup of SI_USER */ 15 - #endif /* __KERNEL__ */ 16 - 17 10 #endif
+2 -2
arch/alpha/kernel/traps.c
··· 288 288 case 1: /* bugcheck */ 289 289 info.si_signo = SIGTRAP; 290 290 info.si_errno = 0; 291 - info.si_code = TRAP_FIXME; 291 + info.si_code = TRAP_UNK; 292 292 info.si_addr = (void __user *) regs->pc; 293 293 info.si_trapno = 0; 294 294 send_sig_info(SIGTRAP, &info, current); ··· 350 350 case GEN_SUBRNG7: 351 351 default: 352 352 signo = SIGTRAP; 353 - code = TRAP_FIXME; 353 + code = TRAP_UNK; 354 354 break; 355 355 } 356 356