From owner-svn-src-all@FreeBSD.ORG Sat Jun 26 19:26:20 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D49C1065670; Sat, 26 Jun 2010 19:26:20 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7B8B88FC08; Sat, 26 Jun 2010 19:26:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5QJQKFu034080; Sat, 26 Jun 2010 19:26:20 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5QJQKVR034078; Sat, 26 Jun 2010 19:26:20 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201006261926.o5QJQKVR034078@svn.freebsd.org> From: Michael Tuexen Date: Sat, 26 Jun 2010 19:26:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209540 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jun 2010 19:26:20 -0000 Author: tuexen Date: Sat Jun 26 19:26:20 2010 New Revision: 209540 URL: http://svn.freebsd.org/changeset/base/209540 Log: * 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. MFC after: 3 days. Modified: head/sys/kern/uipc_syscalls.c Modified: head/sys/kern/uipc_syscalls.c ============================================================================== --- head/sys/kern/uipc_syscalls.c Sat Jun 26 18:13:44 2010 (r209539) +++ head/sys/kern/uipc_syscalls.c Sat Jun 26 19:26:20 2010 (r209540) @@ -2409,7 +2409,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 @@ -2523,7 +2523,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 @@ -2677,6 +2677,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,