Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 5 Mar 2013 15:54:50 GMT
From:      Lutz Donnerhacke <lutz@iks-service.de>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   kern/176667: libalias locks on uninitalized data
Message-ID:  <201303051554.r25Fso9u024295@red.freebsd.org>
Resent-Message-ID: <201303051600.r25G01VB029798@freefall.freebsd.org>

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

>Number:         176667
>Category:       kern
>Synopsis:       libalias locks on uninitalized data
>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 Mar 05 16:00:00 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator:     Lutz Donnerhacke
>Release:        FreeBSD 8.3-RELEASE (GENERIC)
>Organization:
IKS Service GmbH
>Environment:
FreeBSD server7.net.encoline.de 8.3-RELEASE FreeBSD 8.3-RELEASE #0: Mon Apr  9 21:23:18 UTC 2012     root@mason.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  amd64

>Description:
While testing terminating a huge number of PPPoX clients the kernel panics while doing in-kernel NAT.

#4 0xffffffff808e8775 at calltrap+0x8
#5 0xffffffff80fa0f01 at HouseKeeping+0xa1
#6 0xffffffff80f9e6ab at LibAliasOutLocked+0x3b

Please note, that the stack trace is incomplete. There are calls to IncrementalCleanup() and DeleteLink(), which are not reported in the stack trace.

The problem seems to come from incorrect locking, so the contents of the libalias database get corrupted.

This patch might be not the full solution, but is an obvious fix for an obvious bug.
>How-To-Repeat:
Setting up ipfw nat, add more then 9000 clients using mpd5.6, generate traffic
>Fix:
--- sys/netinet/libalias/alias_db.c.ORIG        2013-03-05 16:49:13.000000000 +0100
+++ sys/netinet/libalias/alias_db.c     2013-03-05 16:50:09.000000000 +0100
@@ -2767,8 +2767,8 @@
        struct ip_fw rule;      /* On-the-fly built rule */
        int fwhole;             /* Where to punch hole */

-       LIBALIAS_LOCK_ASSERT(la);
        la = lnk->la;
+       LIBALIAS_LOCK_ASSERT(la);

 /* Don't do anything unless we are asked to */
        if (!(la->packetAliasMode & PKT_ALIAS_PUNCH_FW) ||
@@ -2841,8 +2841,8 @@
 {
        struct libalias *la;

-       LIBALIAS_LOCK_ASSERT(la);
        la = lnk->la;
+       LIBALIAS_LOCK_ASSERT(la);
        if (lnk->link_type == LINK_TCP) {
                int fwhole = lnk->data.tcp->fwhole;     /* Where is the firewall
                                                         * hole? */



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



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