From patchwork Mon Jul 27 16:12:00 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Roskin X-Patchwork-Id: 37568 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n6RGC6Mk031425 for ; Mon, 27 Jul 2009 16:12:06 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752018AbZG0QMD (ORCPT ); Mon, 27 Jul 2009 12:12:03 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751546AbZG0QMD (ORCPT ); Mon, 27 Jul 2009 12:12:03 -0400 Received: from c60.cesmail.net ([216.154.195.49]:53193 "EHLO c60.cesmail.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751368AbZG0QMC (ORCPT ); Mon, 27 Jul 2009 12:12:02 -0400 Received: from unknown (HELO smtprelay2.cesmail.net) ([192.168.1.112]) by c60.cesmail.net with ESMTP; 27 Jul 2009 12:12:02 -0400 Received: from [192.168.0.22] (static-72-92-88-10.phlapa.fios.verizon.net [72.92.88.10]) by smtprelay2.cesmail.net (Postfix) with ESMTPSA id 3427C34C6D; Mon, 27 Jul 2009 12:23:19 -0400 (EDT) Subject: Re: [PATCH 1/3] mac80211: cooperate more with network namespaces From: Pavel Roskin To: Johannes Berg Cc: linux-wireless@vger.kernel.org In-Reply-To: <1248710568.8500.7.camel@johannes.local> References: <20090713223333.042733013@sipsolutions.net> <20090713223413.255405284@sipsolutions.net> <1248653082.3106.7.camel@mj> <1248683249.19945.29.camel@johannes.local> <1248708886.2688.4.camel@mj> <1248710387.8500.5.camel@johannes.local> <1248710568.8500.7.camel@johannes.local> Date: Mon, 27 Jul 2009 12:12:00 -0400 Message-Id: <1248711120.6965.6.camel@mj> Mime-Version: 1.0 X-Mailer: Evolution 2.26.3 (2.26.3-1.fc11) Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Mon, 2009-07-27 at 18:02 +0200, Johannes Berg wrote: > Actually, you're using ath5k, right? So we can see what > info->control.vif points to after ath5k has used the skb, because > apparently it's a valid pointer at least, just not a real vif pointer > any more. I'm using ath9k. Here's something interesting I have found. sdata->dev is valid if info->flags is 0x14091 and not valid if it's 0x12091. 0x4000 is IEEE80211_TX_INTFL_NEED_TXPROCESSING and 0x2000 is IEEE80211_TX_INTFL_RCALGO. This patch prevents any panics. Moreover, I get a connection with the correct PSK. diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index 75604cd..dd1fa8b 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c @@ -1889,6 +1889,9 @@ void ieee80211_tx_pending(unsigned long data) struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); struct ieee80211_sub_if_data *sdata; + if (!(info->flags & IEEE80211_TX_INTFL_NEED_TXPROCESSING)) + continue; + if (WARN_ON(!info->control.vif)) { kfree_skb(skb); continue;