kern/176667: libalias locks on uninitalized data

Lutz Donnerhacke lutz at
Tue Mar 5 16:00:02 UTC 2013

>Number:         176667
>Category:       kern
>Synopsis:       libalias locks on uninitalized data
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Mar 05 16:00:00 UTC 2013
>Originator:     Lutz Donnerhacke
>Release:        FreeBSD 8.3-RELEASE (GENERIC)
IKS Service GmbH
FreeBSD 8.3-RELEASE FreeBSD 8.3-RELEASE #0: Mon Apr  9 21:23:18 UTC 2012     root at  amd64

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.
Setting up ipfw nat, add more then 9000 clients using mpd5.6, generate traffic
--- 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 */

        la = lnk->la;

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

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


More information about the freebsd-bugs mailing list