From owner-svn-src-all@freebsd.org Tue Jan 2 19:34:24 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BCCF1EB4FC5; Tue, 2 Jan 2018 19:34:24 +0000 (UTC) (envelope-from emaste@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 mx1.freebsd.org (Postfix) with ESMTPS id 8740A6EE5C; Tue, 2 Jan 2018 19:34:24 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w02JYNQ4022700; Tue, 2 Jan 2018 19:34:23 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w02JYNAY022698; Tue, 2 Jan 2018 19:34:23 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201801021934.w02JYNAY022698@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 2 Jan 2018 19:34:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327500 - head/sys/dev/ath X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/dev/ath X-SVN-Commit-Revision: 327500 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 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: Tue, 02 Jan 2018 19:34:24 -0000 Author: emaste Date: Tue Jan 2 19:34:23 2018 New Revision: 327500 URL: https://svnweb.freebsd.org/changeset/base/327500 Log: ath: fix possible memory disclosures in ioctl handlers Apply the fix from r327499 to additional ioctl handlers. Reported by: Ilja van Sprundel MFC after: 1 week MFC with: r327499 Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/ath/if_ath_lna_div.c head/sys/dev/ath/if_ath_spectral.c Modified: head/sys/dev/ath/if_ath_lna_div.c ============================================================================== --- head/sys/dev/ath/if_ath_lna_div.c Tue Jan 2 19:29:30 2018 (r327499) +++ head/sys/dev/ath/if_ath_lna_div.c Tue Jan 2 19:34:23 2018 (r327500) @@ -189,7 +189,7 @@ ath_lna_div_ioctl(struct ath_softc *sc, struct ath_dia * pointer for us to use below in reclaiming the buffer; * may want to be more defensive. */ - outdata = malloc(outsize, M_TEMP, M_NOWAIT); + outdata = malloc(outsize, M_TEMP, M_NOWAIT | M_ZERO); if (outdata == NULL) { error = ENOMEM; goto bad; @@ -198,6 +198,7 @@ ath_lna_div_ioctl(struct ath_softc *sc, struct ath_dia switch (id) { default: error = EINVAL; + goto bad; } if (outsize < ad->ad_out_size) ad->ad_out_size = outsize; Modified: head/sys/dev/ath/if_ath_spectral.c ============================================================================== --- head/sys/dev/ath/if_ath_spectral.c Tue Jan 2 19:29:30 2018 (r327499) +++ head/sys/dev/ath/if_ath_spectral.c Tue Jan 2 19:34:23 2018 (r327500) @@ -219,7 +219,7 @@ ath_ioctl_spectral(struct ath_softc *sc, struct ath_di * pointer for us to use below in reclaiming the buffer; * may want to be more defensive. */ - outdata = malloc(outsize, M_TEMP, M_NOWAIT); + outdata = malloc(outsize, M_TEMP, M_NOWAIT | M_ZERO); if (outdata == NULL) { error = ENOMEM; goto bad; @@ -282,6 +282,7 @@ ath_ioctl_spectral(struct ath_softc *sc, struct ath_di break; default: error = EINVAL; + goto bad; } if (outsize < ad->ad_out_size) ad->ad_out_size = outsize;