Author: tuexen
Date: Thu Jul  1 12:55:34 2010
New Revision: 209624
URL: http://svn.freebsd.org/changeset/base/209624

Log:
  MFC r209540
   * Do not dereference a NULL pointer when calling an SCTP send syscall
     not providing a destination address and using ktrace.
   * Do not copy out kernel memory when providing sinfo for sctp_recvmsg().
   Both bug where reported by Valentin Nechayev.
   The first bug results in a kernel panic.

Modified:
  stable/8/sys/kern/uipc_syscalls.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/kern/uipc_syscalls.c
==============================================================================
--- stable/8/sys/kern/uipc_syscalls.c   Thu Jul  1 10:26:23 2010        
(r209623)
+++ stable/8/sys/kern/uipc_syscalls.c   Thu Jul  1 12:55:34 2010        
(r209624)
@@ -2413,7 +2413,7 @@ sctp_generic_sendmsg (td, uap)
        if (error)
                goto sctp_bad;
 #ifdef KTRACE
-       if (KTRPOINT(td, KTR_STRUCT))
+       if (to && (KTRPOINT(td, KTR_STRUCT)))
                ktrsockaddr(to);
 #endif
 
@@ -2527,7 +2527,7 @@ sctp_generic_sendmsg_iov(td, uap)
        if (error)
                goto sctp_bad1;
 #ifdef KTRACE
-       if (KTRPOINT(td, KTR_STRUCT))
+       if (to && (KTRPOINT(td, KTR_STRUCT)))
                ktrsockaddr(to);
 #endif
 
@@ -2681,6 +2681,7 @@ sctp_generic_recvmsg(td, uap)
        if (KTRPOINT(td, KTR_GENIO))
                ktruio = cloneuio(&auio);
 #endif /* KTRACE */
+       memset(&sinfo, 0, sizeof(struct sctp_sndrcvinfo));
        CURVNET_SET(so->so_vnet);
        error = sctp_sorecvmsg(so, &auio, (struct mbuf **)NULL,
                    fromsa, fromlen, &msg_flags,
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to