From patchwork Mon Sep 28 18:58:40 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Lamparter X-Patchwork-Id: 7279351 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 7046EBEEA4 for ; Mon, 28 Sep 2015 18:58:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A558D20723 for ; Mon, 28 Sep 2015 18:58:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CCC02206F5 for ; Mon, 28 Sep 2015 18:58:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750866AbbI1S6o (ORCPT ); Mon, 28 Sep 2015 14:58:44 -0400 Received: from mail-wi0-f169.google.com ([209.85.212.169]:37990 "EHLO mail-wi0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750810AbbI1S6n (ORCPT ); Mon, 28 Sep 2015 14:58:43 -0400 Received: by wiclk2 with SMTP id lk2so115133413wic.1 for ; Mon, 28 Sep 2015 11:58:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=from:to:cc:subject:date:message-id:user-agent:mime-version :content-transfer-encoding:content-type; bh=6QJdhz5yR+fKPmP02qteJnGuXOKmwA/EO10qZJ+CMD0=; b=Nw/Qslm9KsgFfhGDvJkYYeXtAUYesi0Ii/LoShL8q7Z17KGarQWdyXHVkb7voRCVlz i5JA55/Rc/LBhz3dNbunIY/APRo05FVhWReQCfwBU7BS9mXd6bncV1762M63w3zgpHwC BsTF5xo/PSEACetd+1z96sbRsZfJwaHQN84pTeUstMMdHBGO0A0ACwWwxcFZW/JyMqGP ahK2kl3wQwbhtL1AomgkecauR0UT92okry9K6KYn23efyXGJn1TN/LKS7lmtfb98em2H ZOmrT8gVX43pA1cYG2il3aPjEBLPFCBVGINnUXqczCY2MLCC3MbAz8zVIxJWwUTwAm/y hUvA== X-Received: by 10.194.115.199 with SMTP id jq7mr25452171wjb.82.1443466722165; Mon, 28 Sep 2015 11:58:42 -0700 (PDT) Received: from debian64.daheim (pD9F893CE.dip0.t-ipconnect.de. [217.248.147.206]) by smtp.googlemail.com with ESMTPSA id hd7sm14513964wib.23.2015.09.28.11.58.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 28 Sep 2015 11:58:41 -0700 (PDT) Received: from localhost.daheim ([127.0.0.1] helo=debian64.localnet) by debian64.daheim with esmtps (TLS1.0:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.86) (envelope-from ) id 1ZgddI-0003fs-Hu; Mon, 28 Sep 2015 20:58:40 +0200 From: Christian Lamparter To: linux-wireless@vger.kernel.org Cc: johannes@sipsolutions.net, helmut.schaa@googlemail.com Subject: [PATCH] mac80211: fix oops in ieee80211_beacon_get_tim Date: Mon, 28 Sep 2015 20:58:40 +0200 Message-ID: <1673287.PfdWxMzLgk@debian64> User-Agent: KMail/4.14.2 (Linux/4.3.0-rc3-wl+; KDE/4.14.12; x86_64; ; ) MIME-Version: 1.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=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, 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 This patch fixes a crash which is triggered by __ieee80211_beacon_get returning NULL. This causes sky_copy to crash later unless the hardware supports BEACON_TX_STATUS feature. Signed-off-by: Christian Lamparter --- "mac80211: Copy tx'ed beacons to monitor mode" added the skb_copy. There are few other possibilities to do this. This is just one. --- net/mac80211/tx.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index f7317a7..666e46b 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c @@ -3530,6 +3530,9 @@ struct sk_buff *ieee80211_beacon_get_tim(struct ieee80211_hw *hw, struct ieee80211_supported_band *sband; int shift; + if (!bcn) + return bcn; + if (tim_offset) *tim_offset = offs.tim_offset;