Module Name: src
Committed By: hannken
Date: Tue Jan 15 17:14:11 UTC 2013
Modified Files:
src/sys/compat/netbsd32: netbsd32_execve.c
Log Message:
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.
To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/compat/netbsd32/netbsd32_execve.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_execve.c
diff -u src/sys/compat/netbsd32/netbsd32_execve.c:1.36 src/sys/compat/netbsd32/netbsd32_execve.c:1.37
--- src/sys/compat/netbsd32/netbsd32_execve.c:1.36 Wed May 2 23:33:11 2012
+++ src/sys/compat/netbsd32/netbsd32_execve.c Tue Jan 15 17:14:11 2013
@@ -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 @@ netbsd32_posix_spawn_fa_alloc(struct pos
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;