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: 7147561 Return-Path: X-Original-To: patchwork-ath10k@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 2AE179F314 for ; Wed, 9 Sep 2015 16:48:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5B5FC209FA for ; Wed, 9 Sep 2015 16:48:41 +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 28FAE20A05 for ; Wed, 9 Sep 2015 16:48:40 +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 1ZZiXx-0005cx-P3; Wed, 09 Sep 2015 16:48:33 +0000 Received: from mail-io0-f177.google.com ([209.85.223.177]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZZiXw-0005Xh-DC for ath10k@lists.infradead.org; Wed, 09 Sep 2015 16:48:32 +0000 Received: by iofb144 with SMTP id b144so29374822iof.1 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=REt7LhlRkYRwkRypB7rRAD+M8SQqsI4jqmfuNicNEGeNggUmk3Y9eHQxVGcVvqfngi XLWDEz/w6mRjz3O5TRQyR9mavO9ahS+OI+0M4/GV15lF5H/N0AKp/GOGVVf5G6wGnQ4p t6zb7eFGURNP+3IQSWTsaoPQFS6ZzZk2oHNqtb1EGMKVaEygg+yBJ9QNd3OshWT8B4Pt 4Jze4sbZIKeUS1bC2O/DMbKyzkAF22HBLit+ozkb6wOQuq4cGUt64Exr3xDGeRXlupIj no1tnx8M+uXkocIXjGZAQ43YF1xrb09TeNdddBwfCaqu6VtVE8AYPDN6YWUxZwBdr0WG rLiA== X-Gm-Message-State: ALoCoQkvHL90luCRQHmmzW7jJmP0+bYUcbMhrNfSz53mU6IbNXj0ZD5pioSXYPO1+LiJJuO+tohm 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150909_094832_518205_6BB00677 X-CRM114-Status: GOOD ( 10.56 ) 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=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_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 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); }