Module Name:    src
Committed By:   msaitoh
Date:           Mon Jul 14 06:21:22 UTC 2014

Modified Files:
        src/sys/kern [netbsd-6]: kern_core.c

Log Message:
Pull up following revision(s) (requested by maxt in ticket #1097):
        sys/kern/kern_core.c: revision 1.23
Fix a read-beyond-end string read.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.20.8.1 src/sys/kern/kern_core.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/kern/kern_core.c
diff -u src/sys/kern/kern_core.c:1.20 src/sys/kern/kern_core.c:1.20.8.1
--- src/sys/kern/kern_core.c:1.20	Sat Sep 24 22:53:50 2011
+++ src/sys/kern/kern_core.c	Mon Jul 14 06:21:22 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_core.c,v 1.20 2011/09/24 22:53:50 christos Exp $	*/
+/*	$NetBSD: kern_core.c,v 1.20.8.1 2014/07/14 06:21:22 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1991, 1993
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_core.c,v 1.20 2011/09/24 22:53:50 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_core.c,v 1.20.8.1 2014/07/14 06:21:22 msaitoh Exp $");
 
 #include <sys/param.h>
 #include <sys/vnode.h>
@@ -155,6 +155,12 @@ coredump(struct lwp *l, const char *patt
 	error = coredump_buildname(p, name, pattern, MAXPATHLEN);
 	mutex_exit(&lim->pl_lock);
 
+	if (error) {
+		mutex_exit(p->p_lock);
+		mutex_exit(proc_lock);
+		goto done;
+	}
+
 	/*
 	 * On a simple filename, see if the filesystem allow us to write
 	 * core dumps there.

Reply via email to