From patchwork Sat Mar 17 14:01:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 10290833 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 87E2060385 for ; Sat, 17 Mar 2018 14:04:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6A7A029139 for ; Sat, 17 Mar 2018 14:04:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5CFC22913C; Sat, 17 Mar 2018 14:04:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D18B129139 for ; Sat, 17 Mar 2018 14:04:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752239AbeCQOBs (ORCPT ); Sat, 17 Mar 2018 10:01:48 -0400 Received: from mail-wr0-f196.google.com ([209.85.128.196]:42071 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751618AbeCQOBs (ORCPT ); Sat, 17 Mar 2018 10:01:48 -0400 Received: by mail-wr0-f196.google.com with SMTP id s18so14208541wrg.9 for ; Sat, 17 Mar 2018 07:01:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=oB+YwwRPpm2/nBlkgssToXduX30gI84yn8aOOJ/DIMQ=; b=GUT0a91CVzwkW38Q01fQZcX27ULJMkXijRNc3bM7uP/BNCQDDLD1DckUht7r/0qHpZ OdQmsurB1j2c86u0tmg2EN2U8KRRhAygBX929qnv3Y3inqh8mRTluDPH/enq85ZkZ4fI EJr6ZP+rk00E72Lk5FrM9hEXpOAfkwQklR5uIoWhMB2AqWyjtFOkQuLf4Wd1UqdLmRaH 816aVJslozV/M+zTU/iCc7VUKY16awpgjeC4rG8U5fDyWhkg/E7fXss3ZOxA6u7OEysm k0e+TUXmZPJMLFBnlssZLeMoiwa/Q8mU6md4r8gA5GHHhdi8la8zuuGKuJ8FGj1NjEIw N8Xw== X-Gm-Message-State: AElRT7Ey0A3x7l07UcBV938hUnvnevHV9pXmF/hWgKoHEzL6CAs2znGu JhZu6mNUiDTruOsD4cDdINYZ1w== X-Google-Smtp-Source: AG47ELufAU+cR2p+vHy8snwfLKD2yysqUYZc+dZMY3MLKsmDd6nsyrFduDs5lv2LljyYl+qPEL2EQQ== X-Received: by 10.223.175.70 with SMTP id z64mr4907244wrc.254.1521295305361; Sat, 17 Mar 2018 07:01:45 -0700 (PDT) Received: from localhost.localdomain ([151.66.2.62]) by smtp.gmail.com with ESMTPSA id g25sm10033732wmc.0.2018.03.17.07.01.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 17 Mar 2018 07:01:44 -0700 (PDT) From: Lorenzo Bianconi To: nbd@nbd.name Cc: linux-wireless@vger.kernel.org Subject: [PATCH] mt76x2: fix warning in ieee80211_get_key_rx_seq() Date: Sat, 17 Mar 2018 15:01:39 +0100 Message-Id: <20180317140139.24724-1-lorenzo.bianconi@redhat.com> X-Mailer: git-send-email 2.16.2 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Fall back to software encryption for hw unsupported ciphers in order to fix the following warning in ieee80211_get_key_rx_seq routine: WARNING: CPU: 1 PID: 1277 at backports-2017-11-01/net/mac80211/key.c: 1010 mt76_wcid_key_setup+0x6c/0x138 [mt76] CPU: 1 PID: 1277 Comm: hostapd Tainted: G W 4.9.86 #0 Stack : 00000000 00000000 80527b4a 00000042 80523824 00000000 00000000 80520000 8fd79a9c 804bbda7 80454c84 00000001 000004fd 80523824 8f7e4ba0 8eceda12 00000010 8006af94 00000001 80520000 804c1f04 804c1f08 80459890 8ec999b4 00000003 800a7840 8f7e4ba0 8eceda12 8121de20 00000000 00000001 00c999b4 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 ... Call Trace: [<8000f52c>] show_stack+0x70/0x8c [<801d8d04>] dump_stack+0x94/0xd0 [<8002bcd4>] __warn+0x110/0x118 [<8002bd70>] warn_slowpath_null+0x1c/0x2c [<8f0415cc>] mt76_wcid_key_setup+0x6c/0x138 [mt76] [<8f1311b4>] mt76x2_dma_cleanup+0xa38/0x1048 [mt76x2e] Fixes: 30ce7f4456ae ("mt76: validate rx CCMP PN") Signed-off-by: Lorenzo Bianconi Acked-by: Felix Fietkau --- drivers/net/wireless/mediatek/mt76/mt76x2_main.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2_main.c b/drivers/net/wireless/mediatek/mt76/mt76x2_main.c index 25f4cebef26d..73c127f92613 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x2_main.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x2_main.c @@ -336,6 +336,17 @@ mt76x2_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, int idx = key->keyidx; int ret; + /* fall back to sw encryption for unsupported ciphers */ + switch (key->cipher) { + case WLAN_CIPHER_SUITE_WEP40: + case WLAN_CIPHER_SUITE_WEP104: + case WLAN_CIPHER_SUITE_TKIP: + case WLAN_CIPHER_SUITE_CCMP: + break; + default: + return -EOPNOTSUPP; + } + /* * The hardware does not support per-STA RX GTK, fall back * to software mode for these.