From owner-svn-src-stable@freebsd.org Sun Dec 24 02:05:20 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 8D0B8E8CEEC; Sun, 24 Dec 2017 02:05:20 +0000 (UTC) (envelope-from ae@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 5736228B8; Sun, 24 Dec 2017 02:05:20 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBO25JnW003596; Sun, 24 Dec 2017 02:05:19 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBO25JQs003595; Sun, 24 Dec 2017 02:05:19 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201712240205.vBO25JQs003595@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sun, 24 Dec 2017 02:05:19 +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: r327141 - stable/11/sys/net X-SVN-Group: stable-11 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: stable/11/sys/net X-SVN-Commit-Revision: 327141 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: Sun, 24 Dec 2017 02:05:20 -0000 Author: ae Date: Sun Dec 24 02:05:19 2017 New Revision: 327141 URL: https://svnweb.freebsd.org/changeset/base/327141 Log: MFC r326898: Fix possible memory leak. vxlan_ftable entries are sorted in descending order, due to wrong arguments order it is possible to stop search before existing element will be found. Then new element will be allocated in vxlan_ftable_update_locked() and can be inserted in the list second time or trigger MPASS() assertion with enabled INVARIANTS. PR: 224371 Modified: stable/11/sys/net/if_vxlan.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/net/if_vxlan.c ============================================================================== --- stable/11/sys/net/if_vxlan.c Sun Dec 24 01:55:12 2017 (r327140) +++ stable/11/sys/net/if_vxlan.c Sun Dec 24 02:05:19 2017 (r327141) @@ -778,7 +778,7 @@ vxlan_ftable_entry_lookup(struct vxlan_softc *sc, cons hash = VXLAN_SC_FTABLE_HASH(sc, mac); LIST_FOREACH(fe, &sc->vxl_ftable[hash], vxlfe_hash) { - dir = vxlan_ftable_addr_cmp(fe->vxlfe_mac, mac); + dir = vxlan_ftable_addr_cmp(mac, fe->vxlfe_mac); if (dir == 0) return (fe); if (dir > 0)