From owner-freebsd-net@FreeBSD.ORG Thu Aug 5 07:22:23 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A5DF1065674; Thu, 5 Aug 2010 07:22:23 +0000 (UTC) (envelope-from alexkozlov0@gmail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 8B0CF8FC16; Thu, 5 Aug 2010 07:22:22 +0000 (UTC) Received: by bwz12 with SMTP id 12so3665052bwz.13 for ; Thu, 05 Aug 2010 00:22:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:date:from:to:subject :message-id:mime-version:content-type:content-disposition; bh=Tp6rUaEp6zlRXwvwzHRuA0vH9yVw3+lB6qJ0VJtg8/A=; b=iisDEZWrTHzmT8rpL5kXT6TlWlXLMg2u14AYw4etHvkr12V/pB2jPNNasgWPJZwnTz zKgsfp0Z91OXEjrIemWE1VuehyrJ/hOL8eGXs5Tw4zWFC3gF5AUC4JOw9HEqsJOfyQwY 9pMhmGs9hUbAdRGFiFx3jKCs/pxiHmQiMQzX0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:date:from:to:subject:message-id:mime-version:content-type :content-disposition; b=siBBF23sNrzMwea4V6QoBEbJDxb9W6a2vPpIzdc1/ptJzZan/0FlGgFQwnBzTvW4oi HEhJCR3efAU4C1Fa1UpH6V6lQddTcHxQFK+6u2Co/QpMlZ/tGAY/zTa7EKKjkfHigC+K 74JJMMlI6DBX87m8lWUtvznvXerw3sxXeHoMA= Received: by 10.204.160.146 with SMTP id n18mr7055310bkx.116.1280991170975; Wed, 04 Aug 2010 23:52:50 -0700 (PDT) Received: from ravenloft.kiev.ua (ravenloft.kiev.ua [94.244.131.95]) by mx.google.com with ESMTPS id a9sm6587357bky.11.2010.08.04.23.52.49 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 04 Aug 2010 23:52:49 -0700 (PDT) Sender: Alex Kozlov Date: Thu, 5 Aug 2010 09:52:16 +0300 From: Alex Kozlov To: nox@freebsd.org, rpaulo@freebsd.org, freebsd-net@FreeBSD.org, bug-followup@FreeBSD.org, spam@rm-rf.kiev.ua Message-ID: <20100805065216.GA53036@ravenloft.kiev.ua> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="Q68bSM7Ycu6FN28Q" Content-Disposition: inline Cc: Subject: Re: kern/149185: [rum] [panic] panic in rum(4) driver on 8.1-R X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Aug 2010 07:22:23 -0000 --Q68bSM7Ycu6FN28Q Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Aug 04, 2010 at 10:02:35PM +0200, Juergen Lock wrote: > Regarding the 8.1 if_rum(4) panics... I got a similar one, extracted > a dump and tried to gather some info for someone who knows the code: > > The zero divide fault was because (apparently) rate was unitialized, > as is > > ((struct ieee80211_node *) m->M_dat.MH.MH_pkthdr.rcvif)->ni_vap->iv_txparms[0] > > i.e. struct ieee80211_txparam &vap->iv_txparms[0] in case it matters. Yes, its seems that ratectl framework sometimes set ni->ni_txrate to 0 This can be mitigated by patch [1] or by setting ucastrate option in ifconfig. Still real issue need to be solved. -- Adios --Q68bSM7Ycu6FN28Q Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="patch.txt" Index: sys/dev/usb/wlan/if_rum.c @@ -1153,9 +1153,11 @@ rate = params->ibp_rate0; if (!ieee80211_isratevalid(ic->ic_rt, rate)) { + device_printf(sc->sc_dev, "invalid rate=%d\n", rate); m_freem(m0); return EINVAL; } + flags = 0; if ((params->ibp_flags & IEEE80211_BPF_NOACK) == 0) flags |= RT2573_TX_NEED_ACK; @@ -1217,6 +1219,13 @@ else rate = ni->ni_txrate; + /* XXX ieee80211_ratectl sometimes set ni->ni_txrate to 0 */ + if (!ieee80211_isratevalid(ic->ic_rt, rate)) { + device_printf(sc->sc_dev, "invalid rate=%d\n", rate); + m_freem(m0); + return EINVAL; + } + if (wh->i_fc[1] & IEEE80211_FC1_WEP) { k = ieee80211_crypto_encap(ni, m0); if (k == NULL) { --Q68bSM7Ycu6FN28Q--