From: Jagger Date: Sun, 8 May 2016 01:36:16 +0000 (+0200) Subject: Print seccomp-bpf arguments in an organized way X-Git-Tag: 1.2~57 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d5162548b30e4cbc8ff3ac0ae0ff0c9862a1ccba;p=platform%2Fupstream%2Fnsjail.git Print seccomp-bpf arguments in an organized way --- diff --git a/subproc.c b/subproc.c index 327d32c..cde3048 100644 --- a/subproc.c +++ b/subproc.c @@ -181,9 +181,14 @@ static void subprocSeccompViolation(struct nsjconf_t *nsjconf, siginfo_t * si) } buf[rdsize - 1] = '\0'; + int sc; + unsigned long arg1, arg2, arg3, arg4, arg5, arg6, sp, pc; + if (sscanf(buf, "%d %lx %lx %lx %lx %lx %lx %lx %lx", &sc, &arg1, &arg2, &arg3, &arg4, &arg5, &arg6, &sp, &pc) != 9) { + return; + } + LOG_W - ("Contents of /proc/%d/syscall (the syscall number goes first, arguments follow): '%s'", - si->si_pid, buf); + ("Syscall number: %d, Arguments: %lx, %lx, %lx, %lx, %lx, %lx, SP: %lx, PC: %lx", sc, arg1, arg2, arg3, arg4, arg5, arg6, sp, pc); } int subprocReap(struct nsjconf_t *nsjconf)