Mpersify printsiginfo_at printer
Fix multiple personalities support in parsers of ptrace, rt_sigqueueinfo, rt_tgsigqueueinfo, rt_sigtimedwait and waitid syscalls by converting printsiginfo_at into a mpersified printer. * printsiginfo.c (siginfo_t): Mpersify. (printsiginfo_at): Wrap function name into MPERS_PRINTER_DECL. * defs.h (printsiginfo_at): Remove. * signal.c (print_sigqueueinfo, sys_rt_sigtimedwait): Use mpersified printsiginfo_at. * process.c (sys_ptrace): Likewise. * wait.c (sys_waitid): Likewise.
This commit is contained in:
parent
cbbc23a2a4
commit
a0b62498fd
1
defs.h
1
defs.h
@ -630,7 +630,6 @@ extern char *sprinttv(char *, struct tcb *, long, enum bitness_t, int special);
|
||||
extern void print_timespec(struct tcb *, long);
|
||||
extern void sprint_timespec(char *, struct tcb *, long);
|
||||
extern void printsigevent(struct tcb *tcp, long arg);
|
||||
extern void printsiginfo_at(struct tcb *tcp, long addr);
|
||||
extern void printfd(struct tcb *, int);
|
||||
extern bool print_sockaddr_by_inode(const unsigned long, const char *);
|
||||
extern void print_dirfd(struct tcb *, int);
|
||||
|
@ -1,9 +1,15 @@
|
||||
#include "defs.h"
|
||||
|
||||
#include DEF_MPERS_TYPE(siginfo_t)
|
||||
|
||||
#include <signal.h>
|
||||
#include <linux/audit.h>
|
||||
|
||||
#include MPERS_DEFS
|
||||
|
||||
#ifndef IN_MPERS
|
||||
#include "printsiginfo.h"
|
||||
#endif
|
||||
|
||||
#include "xlat/audit_arch.h"
|
||||
#include "xlat/sigbus_codes.h"
|
||||
@ -171,6 +177,9 @@ print_si_info(const siginfo_t *sip, bool verbose)
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef IN_MPERS
|
||||
static
|
||||
#endif
|
||||
void
|
||||
printsiginfo(const siginfo_t *sip, bool verbose)
|
||||
{
|
||||
@ -192,8 +201,7 @@ printsiginfo(const siginfo_t *sip, bool verbose)
|
||||
tprints("}");
|
||||
}
|
||||
|
||||
void
|
||||
printsiginfo_at(struct tcb *tcp, long addr)
|
||||
MPERS_PRINTER_DECL(void, printsiginfo_at)(struct tcb *tcp, long addr)
|
||||
{
|
||||
siginfo_t si;
|
||||
|
||||
|
@ -105,7 +105,7 @@ SYS_FUNC(ptrace)
|
||||
printflags(ptrace_setoptions_flags, tcp->u_arg[3], "PTRACE_O_???");
|
||||
break;
|
||||
case PTRACE_SETSIGINFO: {
|
||||
printsiginfo_at(tcp, tcp->u_arg[3]);
|
||||
MPERS_PRINTER_NAME(printsiginfo_at)(tcp, tcp->u_arg[3]);
|
||||
break;
|
||||
}
|
||||
case PTRACE_SETREGSET:
|
||||
@ -131,7 +131,7 @@ SYS_FUNC(ptrace)
|
||||
break;
|
||||
#endif
|
||||
case PTRACE_GETSIGINFO: {
|
||||
printsiginfo_at(tcp, tcp->u_arg[3]);
|
||||
MPERS_PRINTER_NAME(printsiginfo_at)(tcp, tcp->u_arg[3]);
|
||||
break;
|
||||
}
|
||||
case PTRACE_GETREGSET:
|
||||
|
4
signal.c
4
signal.c
@ -633,7 +633,7 @@ print_sigqueueinfo(struct tcb *tcp, int sig, unsigned long uinfo)
|
||||
{
|
||||
printsignal(sig);
|
||||
tprints(", ");
|
||||
printsiginfo_at(tcp, uinfo);
|
||||
MPERS_PRINTER_NAME(printsiginfo_at)(tcp, uinfo);
|
||||
}
|
||||
|
||||
SYS_FUNC(rt_sigqueueinfo)
|
||||
@ -666,7 +666,7 @@ SYS_FUNC(rt_sigtimedwait)
|
||||
}
|
||||
else if (tcp->u_arg[1] != 0) {
|
||||
/* syscall exit, and u_arg[1] wasn't NULL */
|
||||
printsiginfo_at(tcp, tcp->u_arg[1]);
|
||||
MPERS_PRINTER_NAME(printsiginfo_at)(tcp, tcp->u_arg[1]);
|
||||
tprints(", ");
|
||||
}
|
||||
else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user