From owner-svn-src-stable@freebsd.org Wed Dec 27 03:18:14 2017 Return-Path: Delivered-To: svn-src-stable@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 B5E8AE9DD0D; Wed, 27 Dec 2017 03:18:14 +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 7718974348; Wed, 27 Dec 2017 03:18:14 +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 vBR3IDIA053965; Wed, 27 Dec 2017 03:18:13 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBR3IDKd053964; Wed, 27 Dec 2017 03:18:13 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201712270318.vBR3IDKd053964@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 27 Dec 2017 03:18:13 +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: r327229 - stable/11/contrib/tcpdump X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/contrib/tcpdump X-SVN-Commit-Revision: 327229 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 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: Wed, 27 Dec 2017 03:18:14 -0000 Author: emaste Date: Wed Dec 27 03:18:13 2017 New Revision: 327229 URL: https://svnweb.freebsd.org/changeset/base/327229 Log: MFC r317409 by glebius: Cherry-pick 5d3c5151c2b885aab36627bafb8539238da27b2d, it fixes use after free if tcpdump(1) is run on non-existent interface. Modified: stable/11/contrib/tcpdump/tcpdump.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/tcpdump/tcpdump.c ============================================================================== --- stable/11/contrib/tcpdump/tcpdump.c Wed Dec 27 00:34:13 2017 (r327228) +++ stable/11/contrib/tcpdump/tcpdump.c Wed Dec 27 03:18:13 2017 (r327229) @@ -1085,9 +1085,9 @@ open_interface(const char *device, netdissect_options /* * Return an error for our caller to handle. */ - pcap_close(pc); snprintf(ebuf, PCAP_ERRBUF_SIZE, "%s: %s\n(%s)", device, pcap_statustostr(status), cp); + pcap_close(pc); return (NULL); } else if (status == PCAP_ERROR_PERM_DENIED && *cp != '\0') error("%s: %s\n(%s)", device,