From owner-svn-src-stable@freebsd.org Sun Nov 25 18:00:55 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0DCFC113B9CB; Sun, 25 Nov 2018 18:00:55 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A5B3A6FF70; Sun, 25 Nov 2018 18:00:54 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8AD2B20285; Sun, 25 Nov 2018 18:00:52 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAPI0qpA084020; Sun, 25 Nov 2018 18:00:52 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAPI0ojq084011; Sun, 25 Nov 2018 18:00:50 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811251800.wAPI0ojq084011@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 25 Nov 2018 18:00:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r340923 - in stable/11/sys: kern netinet netinet6 ofed/drivers/infiniband/ulp/sdp X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/11/sys: kern netinet netinet6 ofed/drivers/infiniband/ulp/sdp X-SVN-Commit-Revision: 340923 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A5B3A6FF70 X-Spamd-Result: default: False [1.43 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.63)[0.630,0]; NEURAL_SPAM_MEDIUM(0.64)[0.643,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.15)[0.153,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Nov 2018 18:00:55 -0000 Author: markj Date: Sun Nov 25 18:00:50 2018 New Revision: 340923 URL: https://svnweb.freebsd.org/changeset/base/340923 Log: MFC r340783: Plug some networking sysctl leaks. Modified: stable/11/sys/kern/uipc_socket.c stable/11/sys/kern/uipc_usrreq.c stable/11/sys/netinet/ip_divert.c stable/11/sys/netinet/raw_ip.c stable/11/sys/netinet/sctp_sysctl.c stable/11/sys/netinet/tcp_subr.c stable/11/sys/netinet/udp_usrreq.c stable/11/sys/netinet6/ip6_mroute.c stable/11/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/uipc_socket.c ============================================================================== --- stable/11/sys/kern/uipc_socket.c Sun Nov 25 17:56:49 2018 (r340922) +++ stable/11/sys/kern/uipc_socket.c Sun Nov 25 18:00:50 2018 (r340923) @@ -3597,6 +3597,7 @@ void sotoxsocket(struct socket *so, struct xsocket *xso) { + bzero(xso, sizeof(*xso)); xso->xso_len = sizeof *xso; xso->xso_so = so; xso->so_type = so->so_type; Modified: stable/11/sys/kern/uipc_usrreq.c ============================================================================== --- stable/11/sys/kern/uipc_usrreq.c Sun Nov 25 17:56:49 2018 (r340922) +++ stable/11/sys/kern/uipc_usrreq.c Sun Nov 25 18:00:50 2018 (r340923) @@ -1606,7 +1606,7 @@ unp_pcblist(SYSCTL_HANDLER_ARGS) /* * OK, now we're committed to doing something. */ - xug = malloc(sizeof(*xug), M_TEMP, M_WAITOK); + xug = malloc(sizeof(*xug), M_TEMP, M_WAITOK | M_ZERO); UNP_LIST_LOCK(); gencnt = unp_gencnt; n = unp_count; Modified: stable/11/sys/netinet/ip_divert.c ============================================================================== --- stable/11/sys/netinet/ip_divert.c Sun Nov 25 17:56:49 2018 (r340922) +++ stable/11/sys/netinet/ip_divert.c Sun Nov 25 18:00:50 2018 (r340923) @@ -667,6 +667,7 @@ div_pcblist(SYSCTL_HANDLER_ARGS) if (error != 0) return (error); + bzero(&xig, sizeof(xig)); xig.xig_len = sizeof xig; xig.xig_count = n; xig.xig_gen = gencnt; Modified: stable/11/sys/netinet/raw_ip.c ============================================================================== --- stable/11/sys/netinet/raw_ip.c Sun Nov 25 17:56:49 2018 (r340922) +++ stable/11/sys/netinet/raw_ip.c Sun Nov 25 18:00:50 2018 (r340923) @@ -1044,6 +1044,7 @@ rip_pcblist(SYSCTL_HANDLER_ARGS) n = V_ripcbinfo.ipi_count; INP_INFO_RUNLOCK(&V_ripcbinfo); + bzero(&xig, sizeof(xig)); xig.xig_len = sizeof xig; xig.xig_count = n; xig.xig_gen = gencnt; Modified: stable/11/sys/netinet/sctp_sysctl.c ============================================================================== --- stable/11/sys/netinet/sctp_sysctl.c Sun Nov 25 17:56:49 2018 (r340922) +++ stable/11/sys/netinet/sctp_sysctl.c Sun Nov 25 18:00:50 2018 (r340923) @@ -393,6 +393,9 @@ sctp_sysctl_handle_assoclist(SYSCTL_HANDLER_ARGS) SCTP_LTRACE_ERR_RET(NULL, NULL, NULL, SCTP_FROM_SCTP_SYSCTL, EPERM); return (EPERM); } + memset(&xinpcb, 0, sizeof(xinpcb)); + memset(&xstcb, 0, sizeof(xstcb)); + memset(&xraddr, 0, sizeof(xraddr)); LIST_FOREACH(inp, &SCTP_BASE_INFO(listhead), sctp_list) { SCTP_INP_RLOCK(inp); if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE) { Modified: stable/11/sys/netinet/tcp_subr.c ============================================================================== --- stable/11/sys/netinet/tcp_subr.c Sun Nov 25 17:56:49 2018 (r340922) +++ stable/11/sys/netinet/tcp_subr.c Sun Nov 25 18:00:50 2018 (r340923) @@ -1710,6 +1710,7 @@ tcp_pcblist(SYSCTL_HANDLER_ARGS) if (error != 0) return (error); + bzero(&xig, sizeof(xig)); xig.xig_len = sizeof xig; xig.xig_count = n + m; xig.xig_gen = gencnt; Modified: stable/11/sys/netinet/udp_usrreq.c ============================================================================== --- stable/11/sys/netinet/udp_usrreq.c Sun Nov 25 17:56:49 2018 (r340922) +++ stable/11/sys/netinet/udp_usrreq.c Sun Nov 25 18:00:50 2018 (r340923) @@ -849,6 +849,7 @@ udp_pcblist(SYSCTL_HANDLER_ARGS) if (error != 0) return (error); + bzero(&xig, sizeof(xig)); xig.xig_len = sizeof xig; xig.xig_count = n; xig.xig_gen = gencnt; Modified: stable/11/sys/netinet6/ip6_mroute.c ============================================================================== --- stable/11/sys/netinet6/ip6_mroute.c Sun Nov 25 17:56:49 2018 (r340922) +++ stable/11/sys/netinet6/ip6_mroute.c Sun Nov 25 18:00:50 2018 (r340923) @@ -202,7 +202,8 @@ sysctl_mif6table(SYSCTL_HANDLER_ARGS) struct mif6_sctl *out; int error; - out = malloc(sizeof(struct mif6_sctl) * MAXMIFS, M_TEMP, M_WAITOK); + out = malloc(sizeof(struct mif6_sctl) * MAXMIFS, M_TEMP, + M_WAITOK | M_ZERO); for (int i = 0; i < MAXMIFS; i++) { out[i].m6_flags = mif6table[i].m6_flags; out[i].m6_rate_limit = mif6table[i].m6_rate_limit; Modified: stable/11/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c ============================================================================== --- stable/11/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c Sun Nov 25 17:56:49 2018 (r340922) +++ stable/11/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c Sun Nov 25 18:00:50 2018 (r340923) @@ -1810,6 +1810,7 @@ sdp_pcblist(SYSCTL_HANDLER_ARGS) if (error != 0) return (error); + bzero(&xig, sizeof(xig)); xig.xig_len = sizeof xig; xig.xig_count = n; xig.xig_gen = 0;