From patchwork Thu Aug 27 10:57:03 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bob Copeland X-Patchwork-Id: 7083191 Return-Path: X-Original-To: patchwork-ath10k@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 A7A43BEEC1 for ; Thu, 27 Aug 2015 10:58:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8FAF220984 for ; Thu, 27 Aug 2015 10:58:08 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A5EA520980 for ; Thu, 27 Aug 2015 10:58:07 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZUusX-00019c-B7; Thu, 27 Aug 2015 10:57:57 +0000 Received: from merlin.infradead.org ([2001:4978:20e::2]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZUusW-00019E-FN for ath10k@bombadil.infradead.org; Thu, 27 Aug 2015 10:57:56 +0000 Received: from mail-io0-f179.google.com ([209.85.223.179]) by merlin.infradead.org with esmtps (Exim 4.85 #2 (Red Hat Linux)) id 1ZUusU-0004Bn-PC for ath10k@lists.infradead.org; Thu, 27 Aug 2015 10:57:55 +0000 Received: by iodb91 with SMTP id b91so52103271iod.1 for ; Thu, 27 Aug 2015 03:57:31 -0700 (PDT) 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=5+kGf8dst22+0F9nbWnTqZYLmyNV9gzgXrgQk9vtSu0=; b=eqaI7T5bohEGQigBs4llNFtW725PfglQdQN+VJpgJJGM3OMzH93cYQH7iPl25Tldgs /snVovEvfNJgRR3OIuQd4DsqqBPhAmATGLe39i+1rEr3ecYXDAsMCPT85ryl/SpjGyo3 7AnBlwcCMIGJJEVNSlOTWAgkuCqkQ6drhemshJCmhmEAG96hB2PDm7cqL4+TCuqgWxW5 ZdBFTDacwGRoxFMsDhk0vdUD8lA3GteVPXylRuzoob/QzVIWhUnG84auxDiEWwUCorIG r/zpRjUPeQYYhQabt9XD4otNpMXljqAV7Q/tZqVjPB0JoHuMYJqpq1YEIh8mFSgp4KFB +PXg== X-Gm-Message-State: ALoCoQmsNcrLjEjfqcodbuyIzxjVezYFNS0ks/a6jn/aRD3ibqrFU3NXPyAeYk3XqRaLZje2X0Lk X-Received: by 10.107.136.66 with SMTP id k63mr10120153iod.194.1440673051740; Thu, 27 Aug 2015 03:57:31 -0700 (PDT) Received: from hash ([2001:470:1d:6db:230:48ff:fe9d:9c89]) by smtp.gmail.com with ESMTPSA id 12sm1426674ioe.40.2015.08.27.03.57.30 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Aug 2015 03:57:30 -0700 (PDT) Received: from bob by hash with local (Exim 4.84) (envelope-from ) id 1ZUurn-0003Zh-DK; Thu, 27 Aug 2015 06:57:11 -0400 From: Bob Copeland To: linux-wireless@vger.kernel.org Subject: [PATCH 2/3] ath10k: check for encryption before adding MIC_LEN Date: Thu, 27 Aug 2015 06:57:03 -0400 Message-Id: <1440673024-13696-3-git-send-email-me@bobcopeland.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1440673024-13696-1-git-send-email-me@bobcopeland.com> References: <1440673024-13696-1-git-send-email-me@bobcopeland.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150827_065754_868808_B3BECDBF X-CRM114-Status: UNSURE ( 9.36 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.6 (--) X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Bob Copeland , ath10k@lists.infradead.org MIME-Version: 1.0 Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 In the case of raw mode without nohwcrypt parameter, we should still make sure the frame is protected before adding MIC_LEN to avoid skb_under_panic errors. Signed-off-by: Bob Copeland --- drivers/net/wireless/ath/ath10k/htt_tx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath10k/htt_tx.c b/drivers/net/wireless/ath/ath10k/htt_tx.c index 43aa5e2..1c2d869 100644 --- a/drivers/net/wireless/ath/ath10k/htt_tx.c +++ b/drivers/net/wireless/ath/ath10k/htt_tx.c @@ -528,7 +528,8 @@ int ath10k_htt_tx(struct ath10k_htt *htt, struct sk_buff *msdu) ieee80211_has_protected(hdr->frame_control)) { skb_put(msdu, IEEE80211_CCMP_MIC_LEN); } else if (!skb_cb->htt.nohwcrypt && - skb_cb->txmode == ATH10K_HW_TXRX_RAW) { + skb_cb->txmode == ATH10K_HW_TXRX_RAW && + ieee80211_has_protected(hdr->frame_control)) { skb_put(msdu, IEEE80211_CCMP_MIC_LEN); }