strace: Fix SYS_chdir data parsing
authorBarret Rhoden <brho@cs.berkeley.edu>
Tue, 31 Jul 2018 20:09:44 +0000 (16:09 -0400)
committerBarret Rhoden <brho@cs.berkeley.edu>
Tue, 31 Jul 2018 20:12:14 +0000 (16:12 -0400)
I broke this a few commits back.  Our chdir syscall takes a pid for the
first argument, unlike the man page for chdir.

Fixes: 27f971ff2d4e ("strace: Fix issues with a few syscalls")

Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
kern/src/syscall.c

index c46389a..eb23538 100644 (file)
@@ -264,6 +264,7 @@ static void systrace_start_trace(struct kthread *kthread, struct syscall *sysc)
                copy_tracedata_from_user(trace, sysc->arg1, sysc->arg2);
                break;
        case SYS_openat:
                copy_tracedata_from_user(trace, sysc->arg1, sysc->arg2);
                break;
        case SYS_openat:
+       case SYS_chdir:
        case SYS_nmount:
                copy_tracedata_from_user(trace, sysc->arg1, sysc->arg2);
                break;
        case SYS_nmount:
                copy_tracedata_from_user(trace, sysc->arg1, sysc->arg2);
                break;
@@ -271,7 +272,6 @@ static void systrace_start_trace(struct kthread *kthread, struct syscall *sysc)
        case SYS_lstat:
        case SYS_access:
        case SYS_unlink:
        case SYS_lstat:
        case SYS_access:
        case SYS_unlink:
-       case SYS_chdir:
        case SYS_mkdir:
        case SYS_rmdir:
        case SYS_wstat:
        case SYS_mkdir:
        case SYS_rmdir:
        case SYS_wstat: