Module Name: src Committed By: sborrill Date: Fri Dec 13 12:22:39 UTC 2013
Modified Files: src/sys/kern [netbsd-5]: uipc_syscalls.c Log Message: Pull up the following revisions(s) (requested by spz in ticket #1891): sys/kern/uipc_syscalls.c: revision 1.163 If the unix socket is closed before accept, the mbuf returned by m_get() will have an uninitialized length and contain junk from a previous call. Initialize m_len to be 0 to handle this case. Fixes PR/47591 To generate a diff of this commit: cvs rdiff -u -r1.134.4.3 -r1.134.4.4 src/sys/kern/uipc_syscalls.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/uipc_syscalls.c diff -u src/sys/kern/uipc_syscalls.c:1.134.4.3 src/sys/kern/uipc_syscalls.c:1.134.4.4 --- src/sys/kern/uipc_syscalls.c:1.134.4.3 Sun Mar 28 15:32:00 2010 +++ src/sys/kern/uipc_syscalls.c Fri Dec 13 12:22:39 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: uipc_syscalls.c,v 1.134.4.3 2010/03/28 15:32:00 snj Exp $ */ +/* $NetBSD: uipc_syscalls.c,v 1.134.4.4 2013/12/13 12:22:39 sborrill Exp $ */ /*- * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc. @@ -61,7 +61,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: uipc_syscalls.c,v 1.134.4.3 2010/03/28 15:32:00 snj Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uipc_syscalls.c,v 1.134.4.4 2013/12/13 12:22:39 sborrill Exp $"); #include "opt_pipe.h" @@ -182,6 +182,7 @@ do_sys_accept(struct lwp *l, int sock, s return (error); } nam = m_get(M_WAIT, MT_SONAME); + nam->m_len = 0; *new_sock = fd; so = fp->f_data; solock(so);