From patchwork Wed Feb 10 15:08:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 8272601 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E0D53BEEE5 for ; Wed, 10 Feb 2016 15:08:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0BC6D20380 for ; Wed, 10 Feb 2016 15:08:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 20BA720166 for ; Wed, 10 Feb 2016 15:08:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752749AbcBJPIX (ORCPT ); Wed, 10 Feb 2016 10:08:23 -0500 Received: from mail-wm0-f50.google.com ([74.125.82.50]:34523 "EHLO mail-wm0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752183AbcBJPIV (ORCPT ); Wed, 10 Feb 2016 10:08:21 -0500 Received: by mail-wm0-f50.google.com with SMTP id 128so30754954wmz.1 for ; Wed, 10 Feb 2016 07:08:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=XvvAsdz1V/wD6NI6WFSMoHkB5oGZnesyreL3t3vgq80=; b=TLYDaZgqhR5BHTbxTb7qbVLuOJeX9jrT6jinV859iEq7CiUK4a3LN6tbyesmyciZaE KoButNF6I8GL3/EbFPRunGc/nPtlsdQ71UpJWEnmyLvhoxPSnakFHZqX3X1pL72jR066 Pok0DZ3Sz2nYOSM8cFizn/RFjJilcj5dvoSqGmBrCVQwCSnCRIS6y9pyLLIi1kA+kX// s1qnVtkGmzo+mY3ilYZM78bDGCdBvNDyRVjLUmrHL/cX2OpLA5hV0v7fXERpSn7FkmiT daaVvQ4jG9FMfgrM8eq3rNJbC4FNxdEst/NlzNGkXlmmj2uR64qwBlJ0Ga221Q4Eji5H 37Zg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=XvvAsdz1V/wD6NI6WFSMoHkB5oGZnesyreL3t3vgq80=; b=CWQpJxRewnOCkD3ZzUySdEsB3JAYJTImES2JIWiF3Qus9Q/g/FVDJahtI030cSogXG 0qN2sBNErsiVThPkd+6FDvgsG/KQtGhpPbliJg5QccMLCyGMekHxVzKEh4yJGf5nyqc6 z5poqnV/aeo4UfjTgch8HHzn9mYEVHR7JKhDYObtsNIpaopOhGX43oX+22ewKv+PN5Ra y2cdYw4xYkR88H1f8Fu3l6zEJgjul4+tauOpLdcmQ4Z8mRF70zPFUt9Q+vodnbjYhyIS J9ON6nMDSRO86FUT7JXuTKD9lkRsWkIbSYyD6g7CZmCy/kYd0OL3MPUfNCAJubPISwEU Pieg== X-Gm-Message-State: AG10YOTC2Y53sZgUbeNgn8Q7+F9kqYAbMuhxXkujFCeoVT62toKepVEKSCR20o+FktAGYQ== X-Received: by 10.28.23.5 with SMTP id 5mr11954158wmx.82.1455116899728; Wed, 10 Feb 2016 07:08:19 -0800 (PST) Received: from localhost.localdomain (net-188-152-170-117.cust.dsl.teletu.it. [188.152.170.117]) by smtp.gmail.com with ESMTPSA id n9sm3152985wjy.5.2016.02.10.07.08.18 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 10 Feb 2016 07:08:18 -0800 (PST) From: Lorenzo Bianconi To: linux-wireless@vger.kernel.org Cc: Johannes Berg , Sven Eckelmann Subject: [PATCH] mac80211: fix wiphy supported_band access Date: Wed, 10 Feb 2016 16:08:17 +0100 Message-Id: <1455116897-24811-1-git-send-email-lorenzo.bianconi83@gmail.com> X-Mailer: git-send-email 2.5.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Fix wiphy supported_band access in tx radiotap parsing. In particular, info->band is always set to 0 (IEEE80211_BAND_2GHZ) since it has not assigned yet. This cause a kernel crash on 5GHz only devices. Move ieee80211_parse_tx_radiotap() after info->band assignment Signed-off-by: Lorenzo Bianconi --- net/mac80211/tx.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index 7bb67fa..b07d037 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c @@ -1892,10 +1892,6 @@ netdev_tx_t ieee80211_monitor_start_xmit(struct sk_buff *skb, info->flags = IEEE80211_TX_CTL_REQ_TX_STATUS | IEEE80211_TX_CTL_INJECTED; - /* process and remove the injection radiotap header */ - if (!ieee80211_parse_tx_radiotap(local, skb)) - goto fail; - rcu_read_lock(); /* @@ -1957,6 +1953,10 @@ netdev_tx_t ieee80211_monitor_start_xmit(struct sk_buff *skb, goto fail_rcu; info->band = chandef->chan->band; + /* process and remove the injection radiotap header */ + if (!ieee80211_parse_tx_radiotap(local, skb)) + goto fail_rcu; + ieee80211_xmit(sdata, NULL, skb); rcu_read_unlock();