NetBSD Problem Report #29326
From gson@araneus.fi Thu Feb 10 13:31:53 2005
Return-Path: <gson@araneus.fi>
Received: from gusto.araneus.fi (gusto.araneus.fi [204.152.189.154])
by narn.netbsd.org (Postfix) with ESMTP id 6BB7F63B400
for <gnats-bugs@gnats.NetBSD.org>; Thu, 10 Feb 2005 13:31:53 +0000 (UTC)
Message-Id: <200502101331.j1ADVd6q012130@guava.araneus.fi>
Date: Thu, 10 Feb 2005 15:31:39 +0200 (EET)
From: gson@gson.org (Andreas Gustafsson)
Reply-To: gson@gson.org (Andreas Gustafsson)
To: gnats-bugs@netbsd.org
Subject: atu(4) panics on repeated ifconfig up / down
X-Send-Pr-Version: 3.95
>Number: 29326
>Category: kern
>Synopsis: atu(4) panics on repeated ifconfig up/down
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: joff
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Thu Feb 10 13:32:00 +0000 2005
>Closed-Date: Fri Feb 25 14:48:56 +0000 2005
>Last-Modified: Fri Feb 25 14:48:56 +0000 2005
>Originator: Andreas Gustafsson
>Release: NetBSD-current as of Feb 7, 2005
>Organization:
>Environment:
System: NetBSD guitar.araneus.fi 2.99.15 NetBSD 2.99.15 (GUITAR_KGDB_NOOPT) #0: Thu Feb 10 13:31:47 EET 2005 gson@guava.araneus.fi:/usr/src/sys/arch/i386/compile/GUITAR_KGDB_NOOPT i386
Architecture: i386
Machine: i386
>Description:
Repeatedly configuring an atu(4) device up and down crashes NetBSD.
>How-To-Repeat:
Connect a USB 802.11b adapter supported by the atu(4) driver.
I used a TRENDnet TEW-229UB. Place it in the proximity of an
802.11b access point with no encryption configured.
Enter the commands
ifconfig atu0 up
ifconfig atu0 down
ifconfig atu0 up
ifconfig atu0 down
If necessary, repeat a few times. See the kernel panic.
Here's a backtrace:
Program received signal SIGSEGV, Segmentation fault.
0xc043d86d in m_copydata (m=0xc12ad600, off=0, len=30, vp=0x8) at ../../../../kern/uipc_mbuf.c:690
690 memcpy(cp, mtod(m, caddr_t) + off, count);
(gdb) t
[Current thread is 0 (Thread 42000)]
(gdb) where
#0 0xc043d86d in m_copydata (m=0xc12ad600, off=0, len=30, vp=0x8) at ../../../../kern/uipc_mbuf.c:690
#1 0xc06de11b in atu_tx_start (sc=0xc128f000, ni=0xc146f800, c=0xc128ff4c, m=0xc12ad600) at ../../../../dev/usb/if_atu.c:1727
#2 0xc06de572 in atu_start (ifp=0xc128f038) at ../../../../dev/usb/if_atu.c:1855
#3 0xc04b7391 in ieee80211_mgmt_output (ifp=0xc128f038, ni=0xc146f800, m=0xc12ad600, type=176) at ../../../../net80211/ieee80211_output.c:180
#4 0xc04b8a0c in ieee80211_send_mgmt (ic=0xc128f038, ni=0xc146f800, type=176, arg=1) at ../../../../net80211/ieee80211_output.c:807
#5 0xc04b9946 in ieee80211_newstate (ic=0xc128f038, nstate=IEEE80211_S_AUTH, mgt=-1) at ../../../../net80211/ieee80211_proto.c:471
#6 0xc06dcd04 in atu_newstate (ic=0xc128f038, nstate=IEEE80211_S_AUTH, arg=-1) at ../../../../dev/usb/if_atu.c:1131
#7 0xc04b5b6c in ieee80211_end_scan (ic=0xc128f038) at ../../../../net80211/ieee80211_node.c:444
#8 0xc06dcb87 in atu_task (arg=0xc128f000) at ../../../../dev/usb/if_atu.c:1083
#9 0xc069d8ee in usb_task_thread (arg=0xcad2b108) at ../../../../dev/usb/usb.c:366
#10 0xc0100331 in proc_trampoline ()
(gdb) print cp
$1 = 0x8 <Address 0x8 out of bounds>
(gdb) up
#1 0xc06de11b in atu_tx_start (sc=0xc128f000, ni=0xc146f800, c=0xc128ff4c, m=0xc14a7f00) at ../../../../dev/usb/if_atu.c:1727
1727 m_copydata(m, 0, m->m_pkthdr.len, c->atu_buf + ATU_TX_HDRLEN);
(gdb) print c->atu_buf
$2 = 0x0
(gdb) print *c
$3 = {atu_sc = 0xc128f000, atu_xfer = 0x0, atu_buf = 0x0, atu_mbuf = 0x0, atu_idx = 7 '\a', atu_length = 114, atu_in_xfer = 1, atu_list = { sle_next = 0xc128ff30}}
>Fix:
Unknown.
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: kern-bug-people->joff
Responsible-Changed-By: joff@netbsd.org
Responsible-Changed-When: Thu, 24 Feb 2005 06:08:26 +0000
Responsible-Changed-Why:
mine
State-Changed-From-To: open->feedback
State-Changed-By: joff@netbsd.org
State-Changed-When: Thu, 24 Feb 2005 06:08:26 +0000
State-Changed-Why:
Please try rev 1.3 of src/sys/dev/usb/if_atu.c
From: "Jesse Off" <joff@embeddedARM.com>
To: "Andreas Gustafsson" <gson@gson.org>
Cc: gnats-bugs@netbsd.org, "Andreas Gustafsson" <gson@gson.org>
Subject: Re: kern/29326
Date: Thu, 24 Feb 2005 21:51:28 -0700 (MST)
> joff@netbsd.org writes:
>> Please try rev 1.3 of src/sys/dev/usb/if_atu.c
>
> It's still crashing:
I can't reproduce the crash over here anymore (though I am on a USB 1.1
evbarm board). I've just been using while true; do ifconfig atu0 down;
ifconfig atu0 up; done. Please try this patch to src/sys/dev/usb/if_atu.c
or let me know a sure-fire way to reproduce the problem.
Index: if_atu.c
===================================================================
RCS file: /cvsroot/src/sys/dev/usb/if_atu.c,v
retrieving revision 1.3
diff -u -r1.3 if_atu.c
--- if_atu.c 24 Feb 2005 06:06:11 -0000 1.3
+++ if_atu.c 25 Feb 2005 04:49:47 -0000
@@ -2155,6 +2155,7 @@
int s;
s = splnet();
+ ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE);
ifp->if_timer = 0;
/* Stop transfers. */
@@ -2194,6 +2195,5 @@
/* Let's be nice and turn off the radio before we leave */
atu_switch_radio(sc, 0);
- ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE);
splx(s);
}
From: gson@gson.org (Andreas Gustafsson)
To: "Jesse Off" <joff@embeddedARM.com>
Cc: "Andreas Gustafsson" <gson@gson.org>, gnats-bugs@netbsd.org
Subject: Re: kern/29326
Date: Fri, 25 Feb 2005 11:51:21 +0200
Jesse Off writes:
> I can't reproduce the crash over here anymore (though I am on a USB 1.1
> evbarm board). I've just been using while true; do ifconfig atu0 down;
> ifconfig atu0 up; done. Please try this patch to src/sys/dev/usb/if_atu.c
> or let me know a sure-fire way to reproduce the problem.
It no longer crashes after applying the patch.
--
Andreas Gustafsson, gson@gson.org
State-Changed-From-To: feedback->closed
State-Changed-By: joff@netbsd.org
State-Changed-When: Fri, 25 Feb 2005 14:48:56 +0000
State-Changed-Why:
Originator reports fixed in rev 1.4 of if_atu.c
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.