Source-Changes-HG archive

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

[src/netbsd-6]: src/sys/kern Pull up following revision(s) (requested by spz ...



details:   https://anonhg.NetBSD.org/src/rev/a6e95e8e4afb
branches:  netbsd-6
changeset: 776514:a6e95e8e4afb
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Sat Dec 14 19:36:33 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 51a41d645730 -r a6e95e8e4afb sys/kern/uipc_syscalls.c
--- a/sys/kern/uipc_syscalls.c  Sat Dec 14 19:33:28 2013 +0000
+++ b/sys/kern/uipc_syscalls.c  Sat Dec 14 19:36:33 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uipc_syscalls.c,v 1.154.2.4 2013/02/18 22:00:49 riz Exp $      */
+/*     $NetBSD: uipc_syscalls.c,v 1.154.2.5 2013/12/14 19:36:33 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.4 2013/02/18 22:00:49 riz Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_syscalls.c,v 1.154.2.5 2013/12/14 19:36:33 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