#include "xlat/cap.h"
+static void
+print_prctl_args(struct tcb *tcp, const unsigned int first)
+{
+ unsigned int i;
+
+ for (i = first; i < tcp->s_ent->nargs; ++i)
+ tprintf(", %#lx", tcp->u_arg[i]);
+}
+
SYS_FUNC(prctl)
{
unsigned int i;
if (entering(tcp))
tprints(", ");
else
- printnum_long(tcp, tcp->u_arg[1], "%#lx");
+ printnum_ptr(tcp, tcp->u_arg[1]);
break;
case PR_GET_TSC:
"PR_MCE_KILL_???");
else
tprintf("%#lx", tcp->u_arg[2]);
- for (i = 3; i < tcp->s_ent->nargs; i++)
- tprintf(", %#lx", tcp->u_arg[i]);
+ print_prctl_args(tcp, 3);
return RVAL_DECODED;
case PR_SET_NAME:
printstr(tcp, tcp->u_arg[1], TASK_COMM_LEN);
return RVAL_DECODED;
+#ifdef __ANDROID__
+# ifndef PR_SET_VMA
+# define PR_SET_VMA 0x53564d41
+# endif
+# ifndef PR_SET_VMA_ANON_NAME
+# define PR_SET_VMA_ANON_NAME 0
+# endif
+ case PR_SET_VMA:
+ if (tcp->u_arg[1] == PR_SET_VMA_ANON_NAME) {
+ tprintf(", %lu", tcp->u_arg[1]);
+ tprintf(", %#lx", tcp->u_arg[2]);
+ tprintf(", %lu, ", tcp->u_arg[3]);
+ printstr(tcp, tcp->u_arg[4], -1);
+ } else {
+ /* There are no other sub-options now, but there
+ * might be in future... */
+ print_prctl_args(tcp, 1);
+ }
+ return RVAL_DECODED;
+#endif
+
case PR_SET_MM:
tprints(", ");
printxval(pr_set_mm, tcp->u_arg[1], "PR_SET_MM_???");
- for (i = 2; i < tcp->s_ent->nargs; i++)
- tprintf(", %#lx", tcp->u_arg[i]);
+ print_prctl_args(tcp, 2);
return RVAL_DECODED;
case PR_SET_PDEATHSIG:
print_seccomp_filter(tcp, tcp->u_arg[2]);
return RVAL_DECODED;
}
- for (i = 2; i < tcp->s_ent->nargs; i++)
- tprintf(", %#lx", tcp->u_arg[i]);
+ print_prctl_args(tcp, 2);
return RVAL_DECODED;
case PR_SET_SECUREBITS:
case PR_SET_NO_NEW_PRIVS:
case PR_SET_THP_DISABLE:
tprintf(", %lu", tcp->u_arg[1]);
- for (i = 2; i < tcp->s_ent->nargs; i++)
- tprintf(", %#lx", tcp->u_arg[i]);
+ print_prctl_args(tcp, 2);
return RVAL_DECODED;
case PR_GET_NO_NEW_PRIVS:
case PR_GET_THP_DISABLE:
- if (entering(tcp))
- return printargs(tcp);
+ if (entering(tcp)) {
+ print_prctl_args(tcp, 1);
+ return 0;
+ }
return syserror(tcp) ? 0 : RVAL_UDECIMAL;
case PR_MCE_KILL_GET:
- if (entering(tcp))
- return printargs(tcp);
+ if (entering(tcp)) {
+ print_prctl_args(tcp, 1);
+ return 0;
+ }
if (syserror(tcp))
return 0;
tcp->auxstr = xlookup(pr_mce_kill_policy, tcp->u_rval);
case PR_MPX_DISABLE_MANAGEMENT:
case PR_MPX_ENABLE_MANAGEMENT:
default:
- printargs(tcp);
+ print_prctl_args(tcp, 1);
return RVAL_DECODED;
}
return 0;
if (entering(tcp))
tprints(", ");
else
- printnum_long(tcp, tcp->u_arg[1], "%#lx");
+ printnum_ptr(tcp, tcp->u_arg[1]);
return 0;
}