Make sure "args" is pointing somewhere sane before calling trace_exit().

This commit is contained in:
mycroft 2003-10-29 04:58:26 +00:00
parent 4d9cb8213a
commit 01ffeba8a0
3 changed files with 18 additions and 12 deletions

View File

@ -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. * Copyright (c) 2000 The NetBSD Foundation, Inc.
@ -102,7 +102,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */ #include <sys/cdefs.h> /* 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 <sys/param.h> #include <sys/param.h>
#include <sys/systm.h> #include <sys/systm.h>
@ -267,7 +267,7 @@ linux_syscall_fancy(struct lwp *l, u_int64_t code, struct trapframe *framep)
const struct sysent *callp; const struct sysent *callp;
int error; int error;
u_int64_t rval[2]; u_int64_t rval[2];
u_int64_t *args = NULL, copyargs[10]; /* XXX */ u_int64_t *args, copyargs[10];
u_int hidden, nargs; u_int hidden, nargs;
struct proc *p = l->l_proc; struct proc *p = l->l_proc;
@ -297,8 +297,10 @@ linux_syscall_fancy(struct lwp *l, u_int64_t code, struct trapframe *framep)
default: default:
error = copyin((caddr_t)alpha_pal_rdusp(), &copyargs[6], error = copyin((caddr_t)alpha_pal_rdusp(), &copyargs[6],
(nargs - 6) * sizeof(u_int64_t)); (nargs - 6) * sizeof(u_int64_t));
if (error) if (error) {
args = copyargs;
goto bad; goto bad;
}
case 6: case 6:
copyargs[5] = framep->tf_regs[FRAME_A5]; copyargs[5] = framep->tf_regs[FRAME_A5];
case 5: case 5:

View File

@ -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. * Copyright (c) 2000 The NetBSD Foundation, Inc.
@ -102,7 +102,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */ #include <sys/cdefs.h> /* 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 <sys/param.h> #include <sys/param.h>
#include <sys/systm.h> #include <sys/systm.h>
@ -263,7 +263,7 @@ osf1_syscall_fancy(struct lwp *l, u_int64_t code, struct trapframe *framep)
const struct sysent *callp; const struct sysent *callp;
int error; int error;
u_int64_t rval[2]; u_int64_t rval[2];
u_int64_t *args = NULL, copyargs[10]; /* XXX */ u_int64_t *args, copyargs[10];
u_int hidden, nargs; u_int hidden, nargs;
struct proc *p = l->l_proc; struct proc *p = l->l_proc;
@ -293,8 +293,10 @@ osf1_syscall_fancy(struct lwp *l, u_int64_t code, struct trapframe *framep)
default: default:
error = copyin((caddr_t)alpha_pal_rdusp(), &copyargs[6], error = copyin((caddr_t)alpha_pal_rdusp(), &copyargs[6],
(nargs - 6) * sizeof(u_int64_t)); (nargs - 6) * sizeof(u_int64_t));
if (error) if (error) {
args = copyargs;
goto bad; goto bad;
}
case 6: case 6:
copyargs[5] = framep->tf_regs[FRAME_A5]; copyargs[5] = framep->tf_regs[FRAME_A5];
case 5: case 5:

View File

@ -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. * Copyright (c) 2000 The NetBSD Foundation, Inc.
@ -100,7 +100,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */ #include <sys/cdefs.h> /* 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 <sys/param.h> #include <sys/param.h>
#include <sys/systm.h> #include <sys/systm.h>
@ -265,7 +265,7 @@ syscall_fancy(struct lwp *l, u_int64_t code, struct trapframe *framep)
const struct sysent *callp; const struct sysent *callp;
int error; int error;
u_int64_t rval[2]; u_int64_t rval[2];
u_int64_t *args = NULL, copyargs[10]; /* XXX */ u_int64_t *args, copyargs[10];
u_int hidden, nargs; u_int hidden, nargs;
struct proc *p = l->l_proc; struct proc *p = l->l_proc;
@ -299,8 +299,10 @@ syscall_fancy(struct lwp *l, u_int64_t code, struct trapframe *framep)
default: default:
error = copyin((caddr_t)alpha_pal_rdusp(), &copyargs[6], error = copyin((caddr_t)alpha_pal_rdusp(), &copyargs[6],
(nargs - 6) * sizeof(u_int64_t)); (nargs - 6) * sizeof(u_int64_t));
if (error) if (error) {
args = copyargs;
goto bad; goto bad;
}
case 6: case 6:
copyargs[5] = framep->tf_regs[FRAME_A5]; copyargs[5] = framep->tf_regs[FRAME_A5];
case 5: case 5: