Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-6-0]: src/sys/kern Pull up following revision(s) (requested by sp...
details: https://anonhg.NetBSD.org/src/rev/f49685d64eca
branches: netbsd-6-0
changeset: 774888:f49685d64eca
user: bouyer <bouyer%NetBSD.org@localhost>
date: Sat Dec 14 19:37:02 2013 +0000
description:
Pull up following revision(s) (requested by spz in ticket #996):
sys/kern/uipc_syscalls.c: revision 1.163
PR/47591: Michael Plass: If the unix socket is closed before accept,
unp->unp_conn will be NULL in PRU_ACCEPT, as called from
sys_accept->so_accept. This will cause the usrreq to return with
no error, leaving the mbuf gotten from m_get() with an uninitialized
length, containing junk from a previous call. Initialize m_len to
be 0 to handle this case. This is yet another reason why Beverly's
idea of setting m_len = 0 in m_get() makes a lot of sense. Arguably
this could be an error, since the data we return now has 0 family
and length.
diffstat:
sys/kern/uipc_syscalls.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diffs (26 lines):
diff -r db8fc2d10749 -r f49685d64eca sys/kern/uipc_syscalls.c
--- a/sys/kern/uipc_syscalls.c Sat Dec 14 19:33:45 2013 +0000
+++ b/sys/kern/uipc_syscalls.c Sat Dec 14 19:37:02 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uipc_syscalls.c,v 1.154.2.1.4.1 2013/01/07 16:53:36 riz Exp $ */
+/* $NetBSD: uipc_syscalls.c,v 1.154.2.1.4.2 2013/12/14 19:37:02 bouyer 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.154.2.1.4.1 2013/01/07 16:53:36 riz Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_syscalls.c,v 1.154.2.1.4.2 2013/12/14 19:37:02 bouyer Exp $");
#include "opt_pipe.h"
@@ -184,6 +184,7 @@
return (error);
}
nam = m_get(M_WAIT, MT_SONAME);
+ nam->m_len = 0;
*new_sock = fd;
so = fp->f_data;
solock(so);
Home |
Main Index |
Thread Index |
Old Index