Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Oct 2012 14:54:04 GMT
From:      Andrew Smedley <andrsmed@cisco.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   kern/172985: [patch] [ip6] lltable leak when adding and removing IPv6 addresses
Message-ID:  <201210231454.q9NEs4LT012950@red.freebsd.org>
Resent-Message-ID: <201210231500.q9NF00co096408@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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@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:



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