From patchwork Mon Aug 18 11:19:09 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Kazior X-Patchwork-Id: 380975 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 D93251400FA for ; Mon, 18 Aug 2014 21:31:23 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751449AbaHRLbQ (ORCPT ); Mon, 18 Aug 2014 07:31:16 -0400 Received: from mail-la0-f54.google.com ([209.85.215.54]:64136 "EHLO mail-la0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750710AbaHRLbP (ORCPT ); Mon, 18 Aug 2014 07:31:15 -0400 Received: by mail-la0-f54.google.com with SMTP id hz20so4496017lab.27 for ; Mon, 18 Aug 2014 04:31:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tieto.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=TZOAxShBe8zfBCfIkoPe39tSRLu92zC43bq2/VsRKV0=; b=kURI/nje4xvUzV3jxBKGISKCMz399DksXxN5V+GavcRNvYi5mEIo5X5Svnw505FpOw ueWSP6YMC4aWpQFXcINEYPtBHJgkNPNKxzGUnC4aX5eIz+lM2IR48cx0oNbqcWUSDeKS G3/8DjxoZZio4Tq9OJ+/sStE8LcLYc72CvOts= 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:in-reply-to :references; bh=TZOAxShBe8zfBCfIkoPe39tSRLu92zC43bq2/VsRKV0=; b=FxhzyIjXyE0VYoNIgBd5w14CI3w+jDPlbGfBkKRXQ4QuFHpP/lLBjlYJNyOcRFZJve fXHtuQFZHt67EH1IDPoQ7uXiolVo+IuDPBXHCPR2N+gJD0/gpWfv53UIVGuSeRU2l5qr XLSNUPix2jDSjo4gVSd3kEcXt15xSg2RQN0KeHEroKJqrf3oiKaVU9YLqv962ZrYJlNB U6lT0CajmHMEu8LiCfOEY1k74iYsMyHukF5qQ4GgnxpbZwpq8a3O8ehb0vI8eYPkNk4j hJRMaxUQmw/i0QQ0bcVG5seU/a7Wpt8fV6kyz+KREzFCGC64u2WJAzV5/LOCQOjz00OF D/kQ== X-Gm-Message-State: ALoCoQnWUsWC2irODWiNbco/WlShdcxofdJxAJ6AHa2ER4JXNXJwxGdCoxZ16BvxEbYt5BA+Z0x5K7BISgsJziUomC/s9HKBEh7Jms3Fa5ySFGFCyDdUYbU= X-Received: by 10.152.19.5 with SMTP id a5mr22529998lae.21.1408361473673; Mon, 18 Aug 2014 04:31:13 -0700 (PDT) Received: from localhost.localdomain ([91.198.246.8]) by mx.google.com with ESMTPSA id as3sm26791746lbc.7.2014.08.18.04.31.10 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Aug 2014 04:31:12 -0700 (PDT) From: Michal Kazior To: Linus Torvalds Cc: Johannes Berg , Emmanuel Grumbach , Intel Linux Wireless , "John W. Linville" , Linux Wireless List , Network Development , Luca Coelho , Michal Kazior Subject: [PATCH] mac80211: fix channel switch for chanctx-based drivers Date: Mon, 18 Aug 2014 13:19:09 +0200 Message-Id: <1408360749-10233-1-git-send-email-michal.kazior@tieto.com> X-Mailer: git-send-email 1.8.5.3 In-Reply-To: <1408351816.29649.8.camel@dubbel> References: <1408351816.29649.8.camel@dubbel> X-DomainID: tieto.com Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The new_ctx pointer is set only for non-chanctx drivers. This yielded a crash for chanctx-based drivers during channel switch finalization: BUG: unable to handle kernel NULL pointer dereference at 0000000000000020 IP: ieee80211_vif_use_reserved_switch+0x71c/0xb00 [mac80211] Use an adequate chanctx pointer to fix this. Reported-by: Linus Torvalds Signed-off-by: Michal Kazior Tested-by: Luciano Coelho --- Note: This is based on mac80211-next/master albeit it should apply cleanly on wireless-next/master and v3.17-rc1. I've verified this fix with iwlmvm & 7260. net/mac80211/chan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/mac80211/chan.c b/net/mac80211/chan.c index f3317fa..7367e66 100644 --- a/net/mac80211/chan.c +++ b/net/mac80211/chan.c @@ -1353,7 +1353,7 @@ static int ieee80211_vif_use_reserved_switch(struct ieee80211_local *local) list_del(&sdata->reserved_chanctx_list); list_move(&sdata->assigned_chanctx_list, - &new_ctx->assigned_vifs); + &ctx->assigned_vifs); sdata->reserved_chanctx = NULL; ieee80211_vif_chanctx_reservation_complete(sdata);