From patchwork Wed Sep 9 16:47:35 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bob Copeland X-Patchwork-Id: 7147531 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 7D573BEEC1 for ; Wed, 9 Sep 2015 16:48:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A2BD6209FA for ; Wed, 9 Sep 2015 16:48:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8968C2098C for ; Wed, 9 Sep 2015 16:48:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754605AbbIIQsN (ORCPT ); Wed, 9 Sep 2015 12:48:13 -0400 Received: from mail-io0-f181.google.com ([209.85.223.181]:36143 "EHLO mail-io0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752843AbbIIQsM (ORCPT ); Wed, 9 Sep 2015 12:48:12 -0400 Received: by ioii196 with SMTP id i196so29105655ioi.3 for ; Wed, 09 Sep 2015 09:48:11 -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=aUAEXXbyLzcAJQb2MRjWUZj8ky3vl9bGoSe/Z8oyNoQ=; b=gEEs8dVMCOwPOM1v2LFyXepsAVvuQ2kC15CKWAJmPIYH48BIOUqKaWPffrPAABWYc0 4yORF7qh5Tr9lE26SdgWcflMggBFDcgvGHHLh9L8EmulvemaPypbJQ9ZwYVotDWgT34l gzhaw5vM9AU5UdcFNI39wyUCtjzKg3V+PtDCFbEH0/0AJY4cAZoaxZ4drYGpKWRkYie+ J5qzNEomjOVHdk8V95B2MkFn5fWSHDkZZGP5XUL9vmh3DaqMsmUp0WOZP5ab8xMyWdRs GbMPtHcdwn3LX9y8eMonYLOZt1kTxUNMTI+sBaCz9GTO/eDHnvFdCpOauGrK1c05klLA 4CTg== X-Gm-Message-State: ALoCoQlJscdiFfyYGYMpBvGdwEd0hEqDEiNDzwI2y/i8j0dSfdR+Jz/YYV+6NqAKM0BQFHGhSABQ X-Received: by 10.107.149.77 with SMTP id x74mr50191183iod.112.1441817291397; Wed, 09 Sep 2015 09:48:11 -0700 (PDT) Received: from hash ([2001:470:1d:6db:230:48ff:fe9d:9c89]) by smtp.gmail.com with ESMTPSA id je3sm2078648igb.9.2015.09.09.09.48.10 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Sep 2015 09:48:11 -0700 (PDT) Received: from bob by hash with local (Exim 4.84) (envelope-from ) id 1ZZiXS-00013C-5B; Wed, 09 Sep 2015 12:48:02 -0400 From: Bob Copeland To: linux-wireless@vger.kernel.org Cc: ath10k@lists.infradead.org, Bob Copeland Subject: [PATCH v3 2/3] ath10k: check for encryption before adding MIC_LEN Date: Wed, 9 Sep 2015 12:47:35 -0400 Message-Id: <1441817256-3997-2-git-send-email-me@bobcopeland.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1441817256-3997-1-git-send-email-me@bobcopeland.com> References: <1441817256-3997-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=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 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 ea53c21..eb5ba9b 100644 --- a/drivers/net/wireless/ath/ath10k/htt_tx.c +++ b/drivers/net/wireless/ath/ath10k/htt_tx.c @@ -564,7 +564,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); }