Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 16 Dec 2017 14:36:21 +0000 (UTC)
From:      "Andrey V. Elsukov" <ae@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r326898 - head/sys/net
Message-ID:  <201712161436.vBGEaLUg028087@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ae
Date: Sat Dec 16 14:36:21 2017
New Revision: 326898
URL: https://svnweb.freebsd.org/changeset/base/326898

Log:
  Fix possible memory leak.
  
  vxlan_ftable entries are sorted in ascending 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
  MFC after:	1 week

Modified:
  head/sys/net/if_vxlan.c

Modified: head/sys/net/if_vxlan.c
==============================================================================
--- head/sys/net/if_vxlan.c	Sat Dec 16 14:26:11 2017	(r326897)
+++ head/sys/net/if_vxlan.c	Sat Dec 16 14:36:21 2017	(r326898)
@@ -782,7 +782,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)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201712161436.vBGEaLUg028087>