All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mt76x2: fix warning in ieee80211_get_key_rx_seq()
@ 2018-03-17 14:01 Lorenzo Bianconi
  2018-03-17 21:03 ` Felix Fietkau
  2018-03-27  9:13 ` Kalle Valo
  0 siblings, 2 replies; 3+ messages in thread
From: Lorenzo Bianconi @ 2018-03-17 14:01 UTC (permalink / raw)
  To: nbd; +Cc: linux-wireless

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 <lorenzo.bianconi@redhat.com>
---
 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.
-- 
2.16.2

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] mt76x2: fix warning in ieee80211_get_key_rx_seq()
  2018-03-17 14:01 [PATCH] mt76x2: fix warning in ieee80211_get_key_rx_seq() Lorenzo Bianconi
@ 2018-03-17 21:03 ` Felix Fietkau
  2018-03-27  9:13 ` Kalle Valo
  1 sibling, 0 replies; 3+ messages in thread
From: Felix Fietkau @ 2018-03-17 21:03 UTC (permalink / raw)
  To: Lorenzo Bianconi; +Cc: linux-wireless

On 2018-03-17 15:01, Lorenzo Bianconi wrote:
> 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 <lorenzo.bianconi@redhat.com>
Acked-by: Felix Fietkau <nbd@nbd.name>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: mt76x2: fix warning in ieee80211_get_key_rx_seq()
  2018-03-17 14:01 [PATCH] mt76x2: fix warning in ieee80211_get_key_rx_seq() Lorenzo Bianconi
  2018-03-17 21:03 ` Felix Fietkau
@ 2018-03-27  9:13 ` Kalle Valo
  1 sibling, 0 replies; 3+ messages in thread
From: Kalle Valo @ 2018-03-27  9:13 UTC (permalink / raw)
  To: Lorenzo Bianconi; +Cc: nbd, linux-wireless

Lorenzo Bianconi <lorenzo.bianconi@redhat.com> wrote:

> 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 <lorenzo.bianconi@redhat.com>
> Acked-by: Felix Fietkau <nbd@nbd.name>

Patch applied to wireless-drivers-next.git, thanks.

c03a5aacde0c mt76x2: fix warning in ieee80211_get_key_rx_seq()

-- 
https://patchwork.kernel.org/patch/10290833/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-03-27  9:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-17 14:01 [PATCH] mt76x2: fix warning in ieee80211_get_key_rx_seq() Lorenzo Bianconi
2018-03-17 21:03 ` Felix Fietkau
2018-03-27  9:13 ` Kalle Valo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.