Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/compat/netbsd32 always allocate a full ucontext structur...



details:   https://anonhg.NetBSD.org/src/rev/dea2e45a5320
branches:  trunk
changeset: 780315:dea2e45a5320
user:      christos <christos%NetBSD.org@localhost>
date:      Fri Jul 20 02:27:36 2012 +0000

description:
always allocate a full ucontext structure so that we don't corrupt memory.
XXX: needs pullup to 6?

diffstat:

 sys/compat/netbsd32/netbsd32_lwp.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (36 lines):

diff -r 04d472970891 -r dea2e45a5320 sys/compat/netbsd32/netbsd32_lwp.c
--- a/sys/compat/netbsd32/netbsd32_lwp.c        Fri Jul 20 02:23:35 2012 +0000
+++ b/sys/compat/netbsd32/netbsd32_lwp.c        Fri Jul 20 02:27:36 2012 +0000
@@ -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 @@
 
        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 @@
        return copyout(&lid, SCARG_P32(uap, new_lwp), sizeof(lid));
 
 fail:
-       kmem_free(newuc, sizeof(*newuc));
+       kmem_free(newuc, sizeof(ucontext_t));
        return error;
 }
 



Home | Main Index | Thread Index | Old Index