From patchwork Wed Jun 12 08:00:42 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Calvin Owens X-Patchwork-Id: 250686 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id C99552C007C for ; Wed, 12 Jun 2013 18:01:12 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754175Ab3FLIAy (ORCPT ); Wed, 12 Jun 2013 04:00:54 -0400 Received: from mail-oa0-f47.google.com ([209.85.219.47]:60405 "EHLO mail-oa0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751923Ab3FLIAw (ORCPT ); Wed, 12 Jun 2013 04:00:52 -0400 Received: by mail-oa0-f47.google.com with SMTP id m1so6660254oag.6 for ; Wed, 12 Jun 2013 01:00:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=SHN+SvYNWgkpStFZs+HH1I+Vx2LTSu030c8HkW2ii00=; b=ZJ+4da1yn7L/FzsTQZ0tt40PRX55M3ACFeuWhfUPB+dgAja+GHDTyBjNQiJf7WNqTf Qqxni72mKlwDw1LMkbxzg9cG6KpOjLhT7E4CtfiRjs0giOfIJve1fmWTaezqhaaP12Fx DeVZ9wgP5tYJ52XjN7cbwsW8DtcBOkxLClyxbyxibmFCoJIAe4hrjDZclAjqQ87IsdtT MbxTT0HH+sSOGuvfZnYGntnvXeNDbJZflbkGXyKR6HW/f/0mufPo+IvuvuqhqnIhSO+m e9Q2zjEjZXGHv4P4+4pfPMnyXQE2I09UdEbacLQgUpP5IZH0ZqzhIPozbXDB2Uirpd4U dA3g== X-Received: by 10.60.131.199 with SMTP id oo7mr14465425oeb.51.1371024051900; Wed, 12 Jun 2013 01:00:51 -0700 (PDT) Received: from gmail.com (24-116-241-139.cpe.cableone.net. [24.116.241.139]) by mx.google.com with ESMTPSA id w7sm32179573obx.9.2013.06.12.01.00.50 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 12 Jun 2013 01:00:51 -0700 (PDT) Date: Wed, 12 Jun 2013 03:00:42 -0500 From: Calvin Owens To: Johannes Berg Cc: "Luis R. Rodriguez" , "John W. Linville" , Felix Fietkau , linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, ath9k-devel@lists.ath9k.org, netdev@vger.kernel.org, jcalvinowens@gmail.com Subject: [PATCH] mac80211: Use RCU protection in ieee80211_get_tx_rates() Message-ID: <20130612080042.GA1695@gmail.com> References: <20130609225120.GA2789@gmail.com> <20130610042959.GA1902@gmail.com> <1370950926.8356.14.camel@jlt4.sipsolutions.net> <20130611171304.GA2189@gmail.com> <1370980523.8356.70.camel@jlt4.sipsolutions.net> <20130612075634.GA1649@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20130612075634.GA1649@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Copying the rate table should be done in an RCU read-side critical section. Signed-off-by: Calvin Owens --- net/mac80211/rate.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/net/mac80211/rate.c b/net/mac80211/rate.c index d3f414f..090d9b0 100644 --- a/net/mac80211/rate.c +++ b/net/mac80211/rate.c @@ -538,6 +538,8 @@ static void rate_control_fill_sta_table(struct ieee80211_sta *sta, struct ieee80211_sta_rates *ratetbl = NULL; int i; + rcu_read_lock(); + if (sta && !info->control.skip_table) ratetbl = rcu_dereference(sta->rates); @@ -566,6 +568,8 @@ static void rate_control_fill_sta_table(struct ieee80211_sta *sta, if (rates[i].idx < 0 || !rates[i].count) break; } + + rcu_read_unlock(); } static void rate_control_apply_mask(struct ieee80211_sub_if_data *sdata,