subproc: print si->si_syscall
authorRobert Swiecki <robert@swiecki.net>
Sun, 8 Oct 2017 09:51:37 +0000 (11:51 +0200)
committerRobert Swiecki <robert@swiecki.net>
Sun, 8 Oct 2017 09:51:37 +0000 (11:51 +0200)
cmdline.c
subproc.c

index 9165c1b..e60e74c 100644 (file)
--- a/cmdline.c
+++ b/cmdline.c
@@ -644,7 +644,8 @@ bool cmdlineParse(int argc, char *argv[], struct nsjconf_t * nsjconf)
                                dst = dst ? dst : optarg;
                                if (!mountAddMountPtTail
                                    (nsjconf, /* src= */ optarg, dst, /* fs_type= */ "",
-                                    /* options= */ "", MS_BIND | MS_REC | MS_RDONLY, /* isDir= */
+                                    /* options= */ "", MS_BIND | MS_REC | MS_RDONLY,
+                                    /* isDir= */
                                     NS_DIR_MAYBE, /* mandatory= */ true, NULL, NULL, NULL, 0,
                                     /* is_symlink= */ false)) {
                                        return false;
@@ -657,7 +658,8 @@ bool cmdlineParse(int argc, char *argv[], struct nsjconf_t * nsjconf)
                                if (!mountAddMountPtTail
                                    (nsjconf, /* src= */ optarg, dst, /* fs_type= */ "",
                                     /* options= */ "", MS_BIND | MS_REC, /* isDir= */ NS_DIR_MAYBE,
-                                    /* mandatory= */ true, NULL, NULL, NULL, 0, /* is_symlink= */
+                                    /* mandatory= */ true, NULL, NULL, NULL, 0,
+                                    /* is_symlink= */
                                     false)) {
                                        return false;
                                }
@@ -761,10 +763,10 @@ bool cmdlineParse(int argc, char *argv[], struct nsjconf_t * nsjconf)
                        return false;
                }
        } else {
-               if (!mountAddMountPtHead
-                   (nsjconf, /* src= */ NULL, "/", "tmpfs", /* options= */ "",
-                    nsjconf->is_root_rw ? 0 : MS_RDONLY, /* isDir= */ true, /* mandatory= */ true,
-                    NULL, NULL, NULL, 0, /* is_symlink= */ false)) {
+               if (!mountAddMountPtHead(nsjconf, /* src= */ NULL, "/", "tmpfs", /* options= */ "",
+                                        nsjconf->is_root_rw ? 0 : MS_RDONLY, /* isDir= */ true,
+                                        /* mandatory= */ true,
+                                        NULL, NULL, NULL, 0, /* is_symlink= */ false)) {
                        return false;
                }
        }
index c556a72..26972e4 100644 (file)
--- a/subproc.c
+++ b/subproc.c
@@ -262,12 +262,15 @@ static void subprocSeccompViolation(struct nsjconf_t *nsjconf, siginfo_t * si)
                   &arg5, &arg6, &sp, &pc);
        if (ret == 9) {
                LOG_W
-                   ("PID: %d, Syscall number: %td, Arguments: %#tx, %#tx, %#tx, %#tx, %#tx, %#tx, SP: %#tx, PC: %#tx",
-                    (int)si->si_pid, sc, arg1, arg2, arg3, arg4, arg5, arg6, sp, pc);
+                   ("PID: %d, Syscall number: %td, Arguments: %#tx, %#tx, %#tx, %#tx, %#tx, %#tx, SP: %#tx, PC: %#tx, SI_SYSCALL: %#x",
+                    (int)si->si_pid, sc, arg1, arg2, arg3, arg4, arg5, arg6, sp, pc,
+                    si->si_syscall);
        } else if (ret == 3) {
-               LOG_W("PID: %d, SP: %#tx, PC: %#tx", (int)si->si_pid, arg1, arg2);
+               LOG_W("PID: %d, SP: %#tx, PC: %#tx (SI_SYSCALL: %#x)", (int)si->si_pid, arg1, arg2,
+                     si->si_syscall);
        } else {
-               LOG_W("PID: %d, Syscall string '%s'", (int)si->si_pid, buf);
+               LOG_W("PID: %d, Syscall string '%s' (SI_SYSCALL: %#x)", (int)si->si_pid, buf,
+                     si->si_syscall);
        }
 }