Module Name: src Committed By: christos Date: Fri Jul 20 02:27:36 UTC 2012
Modified Files: src/sys/compat/netbsd32: netbsd32_lwp.c Log Message: always allocate a full ucontext structure so that we don't corrupt memory. XXX: needs pullup to 6? To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/sys/compat/netbsd32/netbsd32_lwp.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/compat/netbsd32/netbsd32_lwp.c diff -u src/sys/compat/netbsd32/netbsd32_lwp.c:1.13 src/sys/compat/netbsd32/netbsd32_lwp.c:1.14 --- src/sys/compat/netbsd32/netbsd32_lwp.c:1.13 Mon May 21 10:15:19 2012 +++ src/sys/compat/netbsd32/netbsd32_lwp.c Thu Jul 19 22:27:36 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_lwp.c,v 1.13 2012/05/21 14:15:19 martin Exp $ */ +/* $NetBSD: netbsd32_lwp.c,v 1.14 2012/07/20 02:27:36 christos Exp $ */ /* * Copyright (c) 2005, 2006, 2007 The NetBSD Foundation. @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: netbsd32_lwp.c,v 1.13 2012/05/21 14:15:19 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_lwp.c,v 1.14 2012/07/20 02:27:36 christos Exp $"); #include <sys/types.h> #include <sys/param.h> @@ -60,7 +60,7 @@ netbsd32__lwp_create(struct lwp *l, cons KASSERT(p->p_emul->e_ucsize == sizeof(*newuc)); - newuc = kmem_alloc(sizeof(ucontext32_t), KM_SLEEP); + newuc = kmem_alloc(sizeof(ucontext_t), KM_SLEEP); error = copyin(SCARG_P32(uap, ucp), newuc, p->p_emul->e_ucsize); if (error) goto fail; @@ -85,7 +85,7 @@ netbsd32__lwp_create(struct lwp *l, cons return copyout(&lid, SCARG_P32(uap, new_lwp), sizeof(lid)); fail: - kmem_free(newuc, sizeof(*newuc)); + kmem_free(newuc, sizeof(ucontext_t)); return error; }