printsiginfo: add SIGSYS decoding
* configure.ac (AC_CHECK_MEMBERS): Check for siginfo_t.si_syscall. * signal.c (SYS_SECCOMP): Define if not yet defined. (sigsys_codes): new xlat structure. (printsiginfo): Decode SIGSYS.
This commit is contained in:
parent
b9d4d21a61
commit
bc091e3ce1
@ -256,7 +256,8 @@ AC_CHECK_TYPES([struct user_desc],,, [#include <asm/ldt.h>])
|
||||
AC_CHECK_MEMBERS([struct utsname.domainname],,, [#include <sys/utsname.h>])
|
||||
|
||||
AC_CHECK_MEMBERS([struct sigevent._sigev_un._pad,
|
||||
struct sigevent.__pad],,, [#include <signal.h>])
|
||||
struct sigevent.__pad,
|
||||
siginfo_t.si_syscall],,, [#include <signal.h>])
|
||||
|
||||
AC_CHECK_TYPES([struct flock64],,, [#include <fcntl.h>])
|
||||
|
||||
|
19
signal.c
19
signal.c
@ -354,6 +354,7 @@ print_sigset_addr_len(struct tcb *tcp, long addr, long len)
|
||||
#define BUS_ADRALN 1 /* invalid address alignment */
|
||||
#define BUS_ADRERR 2 /* non-existant physical address */
|
||||
#define BUS_OBJERR 3 /* object specific hardware error */
|
||||
#define SYS_SECCOMP 1 /* seccomp triggered */
|
||||
#define TRAP_BRKPT 1 /* process breakpoint */
|
||||
#define TRAP_TRACE 2 /* process trace trap */
|
||||
#define CLD_EXITED 1 /* child has exited */
|
||||
@ -503,6 +504,14 @@ static const struct xlat sigbus_codes[] = {
|
||||
XLAT_END
|
||||
};
|
||||
|
||||
#ifndef SYS_SECCOMP
|
||||
# define SYS_SECCOMP 1
|
||||
#endif
|
||||
static const struct xlat sigsys_codes[] = {
|
||||
XLAT(SYS_SECCOMP),
|
||||
XLAT_END
|
||||
};
|
||||
|
||||
static void
|
||||
printsigsource(const siginfo_t *sip)
|
||||
{
|
||||
@ -565,6 +574,9 @@ printsiginfo(siginfo_t *sip, int verbose)
|
||||
case SIGBUS:
|
||||
code = xlookup(sigbus_codes, sip->si_code);
|
||||
break;
|
||||
case SIGSYS:
|
||||
code = xlookup(sigsys_codes, sip->si_code);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (code)
|
||||
@ -640,6 +652,13 @@ printsiginfo(siginfo_t *sip, int verbose)
|
||||
break;
|
||||
}
|
||||
break;
|
||||
#ifdef HAVE_SIGINFO_T_SI_SYSCALL
|
||||
case SIGSYS:
|
||||
tprintf(", si_call_addr=%#lx, si_syscall=%d, si_arch=%u",
|
||||
(unsigned long) sip->si_call_addr,
|
||||
sip->si_syscall, sip->si_arch);
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
if (sip->si_pid || sip->si_uid)
|
||||
printsigsource(sip);
|
||||
|
Loading…
x
Reference in New Issue
Block a user