Source-Changes-HG archive

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

[src/trunk]: src/sys/compat/netbsd32 netbsd32_posix_spawn_fa_alloc: use the r...



details:   https://anonhg.NetBSD.org/src/rev/a080b0e8784a
branches:  trunk
changeset: 784035:a080b0e8784a
user:      hannken <hannken%NetBSD.org@localhost>
date:      Tue Jan 15 17:14:11 2013 +0000

description:
netbsd32_posix_spawn_fa_alloc: use the right length for path allocation.

This error lead to memory pool corruption when freeing kmem with wrong size.

diffstat:

 sys/compat/netbsd32/netbsd32_execve.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 4775a2e794c2 -r a080b0e8784a sys/compat/netbsd32/netbsd32_execve.c
--- a/sys/compat/netbsd32/netbsd32_execve.c     Tue Jan 15 16:52:35 2013 +0000
+++ b/sys/compat/netbsd32/netbsd32_execve.c     Tue Jan 15 17:14:11 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netbsd32_execve.c,v 1.36 2012/05/02 23:33:11 rmind Exp $       */
+/*     $NetBSD: netbsd32_execve.c,v 1.37 2013/01/15 17:14:11 hannken Exp $     */
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -28,7 +28,7 @@
 
 #include <sys/cdefs.h>
 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_execve.c,v 1.36 2012/05/02 23:33:11 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_execve.c,v 1.37 2013/01/15 17:14:11 hannken Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -141,7 +141,7 @@
                    MAXPATHLEN, &slen);
                if (error)
                        goto out;
-               fae->fae_path = kmem_alloc(fal, KM_SLEEP);
+               fae->fae_path = kmem_alloc(slen, KM_SLEEP);
                memcpy(fae->fae_path, pbuf, slen);
                fae->fae_oflag = f32->fae_oflag;
                fae->fae_mode = f32->fae_mode;



Home | Main Index | Thread Index | Old Index