From 01ffeba8a08560dbfcf979a9883d4b9084fd9139 Mon Sep 17 00:00:00 2001 From: mycroft Date: Wed, 29 Oct 2003 04:58:26 +0000 Subject: [PATCH] Make sure "args" is pointing somewhere sane before calling trace_exit(). --- sys/arch/alpha/alpha/linux_syscall.c | 10 ++++++---- sys/arch/alpha/alpha/osf1_syscall.c | 10 ++++++---- sys/arch/alpha/alpha/syscall.c | 10 ++++++---- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/sys/arch/alpha/alpha/linux_syscall.c b/sys/arch/alpha/alpha/linux_syscall.c index 99d14dfb2cdb..9786ccf87c5f 100644 --- a/sys/arch/alpha/alpha/linux_syscall.c +++ b/sys/arch/alpha/alpha/linux_syscall.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_syscall.c,v 1.11 2003/10/27 07:07:35 chs Exp $ */ +/* $NetBSD: linux_syscall.c,v 1.12 2003/10/29 04:58:26 mycroft Exp $ */ /*- * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -102,7 +102,7 @@ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: linux_syscall.c,v 1.11 2003/10/27 07:07:35 chs Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_syscall.c,v 1.12 2003/10/29 04:58:26 mycroft Exp $"); #include #include @@ -267,7 +267,7 @@ linux_syscall_fancy(struct lwp *l, u_int64_t code, struct trapframe *framep) const struct sysent *callp; int error; u_int64_t rval[2]; - u_int64_t *args = NULL, copyargs[10]; /* XXX */ + u_int64_t *args, copyargs[10]; u_int hidden, nargs; struct proc *p = l->l_proc; @@ -297,8 +297,10 @@ linux_syscall_fancy(struct lwp *l, u_int64_t code, struct trapframe *framep) default: error = copyin((caddr_t)alpha_pal_rdusp(), ©args[6], (nargs - 6) * sizeof(u_int64_t)); - if (error) + if (error) { + args = copyargs; goto bad; + } case 6: copyargs[5] = framep->tf_regs[FRAME_A5]; case 5: diff --git a/sys/arch/alpha/alpha/osf1_syscall.c b/sys/arch/alpha/alpha/osf1_syscall.c index dc217cfa9cf4..4c40908521ad 100644 --- a/sys/arch/alpha/alpha/osf1_syscall.c +++ b/sys/arch/alpha/alpha/osf1_syscall.c @@ -1,4 +1,4 @@ -/* $NetBSD: osf1_syscall.c,v 1.13 2003/10/27 07:07:35 chs Exp $ */ +/* $NetBSD: osf1_syscall.c,v 1.14 2003/10/29 04:58:26 mycroft Exp $ */ /*- * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -102,7 +102,7 @@ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: osf1_syscall.c,v 1.13 2003/10/27 07:07:35 chs Exp $"); +__KERNEL_RCSID(0, "$NetBSD: osf1_syscall.c,v 1.14 2003/10/29 04:58:26 mycroft Exp $"); #include #include @@ -263,7 +263,7 @@ osf1_syscall_fancy(struct lwp *l, u_int64_t code, struct trapframe *framep) const struct sysent *callp; int error; u_int64_t rval[2]; - u_int64_t *args = NULL, copyargs[10]; /* XXX */ + u_int64_t *args, copyargs[10]; u_int hidden, nargs; struct proc *p = l->l_proc; @@ -293,8 +293,10 @@ osf1_syscall_fancy(struct lwp *l, u_int64_t code, struct trapframe *framep) default: error = copyin((caddr_t)alpha_pal_rdusp(), ©args[6], (nargs - 6) * sizeof(u_int64_t)); - if (error) + if (error) { + args = copyargs; goto bad; + } case 6: copyargs[5] = framep->tf_regs[FRAME_A5]; case 5: diff --git a/sys/arch/alpha/alpha/syscall.c b/sys/arch/alpha/alpha/syscall.c index e78d0a701b25..bd37f3ba0aa5 100644 --- a/sys/arch/alpha/alpha/syscall.c +++ b/sys/arch/alpha/alpha/syscall.c @@ -1,4 +1,4 @@ -/* $NetBSD: syscall.c,v 1.11 2003/10/27 07:07:35 chs Exp $ */ +/* $NetBSD: syscall.c,v 1.12 2003/10/29 04:58:26 mycroft Exp $ */ /*- * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -100,7 +100,7 @@ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.11 2003/10/27 07:07:35 chs Exp $"); +__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.12 2003/10/29 04:58:26 mycroft Exp $"); #include #include @@ -265,7 +265,7 @@ syscall_fancy(struct lwp *l, u_int64_t code, struct trapframe *framep) const struct sysent *callp; int error; u_int64_t rval[2]; - u_int64_t *args = NULL, copyargs[10]; /* XXX */ + u_int64_t *args, copyargs[10]; u_int hidden, nargs; struct proc *p = l->l_proc; @@ -299,8 +299,10 @@ syscall_fancy(struct lwp *l, u_int64_t code, struct trapframe *framep) default: error = copyin((caddr_t)alpha_pal_rdusp(), ©args[6], (nargs - 6) * sizeof(u_int64_t)); - if (error) + if (error) { + args = copyargs; goto bad; + } case 6: copyargs[5] = framep->tf_regs[FRAME_A5]; case 5: