From patchwork Sun Aug 16 15:25:56 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bob Copeland X-Patchwork-Id: 7023521 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 D9F179F6E5 for ; Mon, 17 Aug 2015 06:51:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2393C204FC for ; Mon, 17 Aug 2015 06:51:46 +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 583C020523 for ; Mon, 17 Aug 2015 06:51:45 +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 1ZREGi-0003tP-7k; Mon, 17 Aug 2015 06:51:40 +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 1ZREBx-0002yW-Nl for ath10k@bombadil.infradead.org; Mon, 17 Aug 2015 06:46:45 +0000 Received: from mail-ig0-f171.google.com ([209.85.213.171]) by merlin.infradead.org with esmtps (Exim 4.85 #2 (Red Hat Linux)) id 1ZQzqO-0007tq-Ai for ath10k@lists.infradead.org; Sun, 16 Aug 2015 15:27:33 +0000 Received: by igui7 with SMTP id i7so41292343igu.1 for ; Sun, 16 Aug 2015 08:26:23 -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=ji3VedOyY4VXVDJPmgoWqk4YXjewVQSfLVH5yfxWEoM=; b=W5hshnJLzt6dUqg3Hiye7LENZ8sBiFrljPGcXs4qB/74roySr/r+x0ZtetVpFrqai/ LYBoM8BrP4oDIwTMf76lgnJmlUo8Etlj2D6ItD48yVd1uzylhkdGI3d9O00Sa+5jUyRr d8pp1fTt08GnGwUb6j3FTj8+TfQxqn2wvx7WgdyFlpieFnJ4kdAbIWRmurNvrrsVseR0 d/7jLphTj4HcJ1QUehGhXjOOPg+erf6a1Yu6UAvOSnT+PI7KQHLHkoWHvVaDDHLaKWTe Tq4XY9Q8/9ifgtol37gSgG+fbIt8341BMavLObUW/vHhABMBXCLfh2w5TDdKGh/FbBZ7 F4Xg== X-Gm-Message-State: ALoCoQk+4YEowLIiDTL0ubWCGHkny25AVfsRc+NEh9WvU6JWNhm7etXNdhJSEnf2/5BKCsXwbYsR X-Received: by 10.50.79.169 with SMTP id k9mr11720121igx.44.1439738783158; Sun, 16 Aug 2015 08:26:23 -0700 (PDT) Received: from hash ([2001:470:1d:6db:230:48ff:fe9d:9c89]) by smtp.gmail.com with ESMTPSA id c7sm7064475igx.21.2015.08.16.08.26.22 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 16 Aug 2015 08:26:22 -0700 (PDT) Received: from bob by hash with local (Exim 4.84) (envelope-from ) id 1ZQzp0-0007cF-Pj; Sun, 16 Aug 2015 11:26:06 -0400 From: Bob Copeland To: ath10k@lists.infradead.org Subject: [PATCH 2/3] ath10k: check for encryption before adding MIC_LEN Date: Sun, 16 Aug 2015 11:25:56 -0400 Message-Id: <1439738757-29199-3-git-send-email-me@bobcopeland.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1439738757-29199-1-git-send-email-me@bobcopeland.com> References: <1439738757-29199-1-git-send-email-me@bobcopeland.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150816_112732_422172_0B77D285 X-CRM114-Status: UNSURE ( 8.91 ) 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 MIME-Version: 1.0 Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.8 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 704bb5e..e0075cf 100644 --- a/drivers/net/wireless/ath/ath10k/htt_tx.c +++ b/drivers/net/wireless/ath/ath10k/htt_tx.c @@ -526,7 +526,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); }