kern/172985: [patch] [ip6] lltable leak when adding and removing IPv6 addresses

Andrew Smedley andrsmed at cisco.com
Tue Oct 23 15:00:01 UTC 2012


>Number:         172985
>Category:       kern
>Synopsis:       [patch] [ip6] lltable leak when adding and removing IPv6 addresses
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Oct 23 15:00:00 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     Andrew Smedley
>Release:        FreeBSD-CURRENT
>Organization:
Cisco
>Environment:
FreeBSD test-freebsd10 10.0-CURRENT FreeBSD 10.0-CURRENT #0 r241078: Mon Oct  1 02:35:30 UTC 2012     root at kaos.glenbarber.us:/usr/obj/usr/src/sys/GENERIC  i386
>Description:
I've found a lltable leak when you add and remove IPv6 addresses. I've made a patch and it appears to address the issue but I'm not familiar with the code so it could do with some code review.
>How-To-Repeat:
# vmstat -m | grep lltable
      lltable    14     4K       -       14  128,256
# ifconfig em0 inet6 3ffe:b00:1:1::1 alias
# vmstat -m | grep lltable
      lltable    15     4K       -       15  128,256
# ifconfig em0 inet6 3ffe:b00:1:1::1 -alias
# vmstat -m | grep lltable
         Type InUse MemUse  HighUse Requests  Size(s)
      lltable    15     4K       -       15  128,256
>Fix:


Patch attached with submission follows:

Index: in6.c
===================================================================
--- in6.c	(revision 241923)
+++ in6.c	(working copy)
@@ -2603,10 +2603,11 @@
 		if (!(lle->la_flags & LLE_IFADDR) || (flags & LLE_IFADDR)) {
 			LLE_WLOCK(lle);
 			lle->la_flags |= LLE_DELETED;
-			LLE_WUNLOCK(lle);
 #ifdef DIAGNOSTIC
 			log(LOG_INFO, "ifaddr cache = %p  is deleted\n", lle);
 #endif
+			LIST_REMOVE(lle, lle_next);
+			LLE_FREE_LOCKED(lle);
 		}
 		lle = (void *)-1;
 	}


>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list