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: 7083141 X-Patchwork-Delegate: kvalo@adurom.com 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 2F202BEEC1 for ; Thu, 27 Aug 2015 10:57:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 63D1F2097D for ; Thu, 27 Aug 2015 10:57:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8BCA420983 for ; Thu, 27 Aug 2015 10:57:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753482AbbH0K5e (ORCPT ); Thu, 27 Aug 2015 06:57:34 -0400 Received: from mail-io0-f169.google.com ([209.85.223.169]:36329 "EHLO mail-io0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753203AbbH0K5c (ORCPT ); Thu, 27 Aug 2015 06:57:32 -0400 Received: by iodv127 with SMTP id v127so52236967iod.3 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=BotocLdFB5+c8hc9Ybc+luw7UmxNVO0d9TDPUUWf+X+/cCbHfgEE8x3wunym56VJC3 gWgf2busgpeIrmaP1fG7rjbuh/c2qjPrszuUmD6sbxLTRV9Am51dLrtWWvLivxOMBOsT Ch6R1yHYzR5tTen1K6p2qhrR43hj69Ly/wAkM2VgHh2yfnrXgCyqr9ezZyVWG0mZ20D7 KxcwftmwVwW8oVWGxoKU2byRfwTQDMBSMXtjoM7Rw4UZdw0dhjL4rQeFr5/cMyivio9z 8e64kC0EwI4wBrJJUrzg5gzjDalecDLcqp45S7Ipi30CJzmm38er0tF8xWstNUaSTc+3 iqzw== X-Gm-Message-State: ALoCoQkbgRPo1UsYMejHNQdP+3mxHLVcHX1ffKE3Lh/w6tEolaTqd6V8TRfq7O6ksB98CR5Fq5/n 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 Cc: ath10k@lists.infradead.org, Bob Copeland 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> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 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); }