svn commit: r327142 - stable/10/sys/net

Andrey V. Elsukov ae at FreeBSD.org
Sun Dec 24 02:06:18 UTC 2017


Author: ae
Date: Sun Dec 24 02:06:16 2017
New Revision: 327142
URL: https://svnweb.freebsd.org/changeset/base/327142

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/10/sys/net/if_vxlan.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/net/if_vxlan.c
==============================================================================
--- stable/10/sys/net/if_vxlan.c	Sun Dec 24 02:05:19 2017	(r327141)
+++ stable/10/sys/net/if_vxlan.c	Sun Dec 24 02:06:16 2017	(r327142)
@@ -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)


More information about the svn-src-stable-10 mailing list