From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from xc.sipsolutions.net ([83.246.72.84]:43159 "EHLO sipsolutions.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753661AbZJ1OVJ (ORCPT ); Wed, 28 Oct 2009 10:21:09 -0400 Subject: [PATCH resend] mac80211: fix BSS leak From: Johannes Berg To: John Linville Cc: linux-wireless In-Reply-To: <1254262165.30589.25.camel@johannes.local> References: <1254262165.30589.25.camel@johannes.local> Content-Type: text/plain; charset="UTF-8" Date: Wed, 28 Oct 2009 15:12:32 +0100 Message-ID: <1256739152.4237.111.camel@johannes.local> Mime-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org List-ID: The IBSS code leaks a BSS struct after telling cfg80211 about a given BSS by passing a frame. Signed-off-by: Johannes Berg --- net/mac80211/ibss.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) --- wireless-testing.orig/net/mac80211/ibss.c 2009-10-27 09:16:01.000000000 +0100 +++ wireless-testing/net/mac80211/ibss.c 2009-10-27 09:42:06.000000000 +0100 @@ -73,6 +73,7 @@ static void __ieee80211_sta_join_ibss(st struct ieee80211_mgmt *mgmt; u8 *pos; struct ieee80211_supported_band *sband; + struct cfg80211_bss *bss; u32 bss_change; u8 supp_rates[IEEE80211_MAX_SUPP_RATES]; @@ -177,8 +178,9 @@ static void __ieee80211_sta_join_ibss(st mod_timer(&ifibss->timer, round_jiffies(jiffies + IEEE80211_IBSS_MERGE_INTERVAL)); - cfg80211_inform_bss_frame(local->hw.wiphy, local->hw.conf.channel, - mgmt, skb->len, 0, GFP_KERNEL); + bss = cfg80211_inform_bss_frame(local->hw.wiphy, local->hw.conf.channel, + mgmt, skb->len, 0, GFP_KERNEL); + cfg80211_put_bss(bss); cfg80211_ibss_joined(sdata->dev, ifibss->bssid, GFP_KERNEL); }