From owner-freebsd-bugs@FreeBSD.ORG Tue Oct 23 15:00:01 2012 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1B781263 for ; Tue, 23 Oct 2012 15:00:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.FreeBSD.org [8.8.178.135]) by mx1.freebsd.org (Postfix) with ESMTP id D797A8FC18 for ; Tue, 23 Oct 2012 15:00:00 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q9NF00UK096409 for ; Tue, 23 Oct 2012 15:00:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q9NF00co096408; Tue, 23 Oct 2012 15:00:00 GMT (envelope-from gnats) Resent-Date: Tue, 23 Oct 2012 15:00:00 GMT Resent-Message-Id: <201210231500.q9NF00co096408@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Andrew Smedley Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EBEE7F8B for ; Tue, 23 Oct 2012 14:54:04 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id D2C0B8FC08 for ; Tue, 23 Oct 2012 14:54:04 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.5/8.14.5) with ESMTP id q9NEs4Ow012951 for ; Tue, 23 Oct 2012 14:54:04 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.5/8.14.5/Submit) id q9NEs4LT012950; Tue, 23 Oct 2012 14:54:04 GMT (envelope-from nobody) Message-Id: <201210231454.q9NEs4LT012950@red.freebsd.org> Date: Tue, 23 Oct 2012 14:54:04 GMT From: Andrew Smedley To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Subject: kern/172985: [patch] [ip6] lltable leak when adding and removing IPv6 addresses X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Oct 2012 15:00:01 -0000 >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: