Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c0c39404 authored by Ahmad Masri's avatar Ahmad Masri Committed by Gerrit - the friendly Code Review server
Browse files

wil6210: Drop plaintext frames on secure network



On secure network, only eap frames are valid unencrypted frames and
allowed to be indicated to the local network, any other unencrypted
frame should be dropped immediately.

Change-Id: Id9d97a4c0984f7bf2d7d6941c4c61e87bc2354cd
Signed-off-by: default avatarAhmad Masri <amasri@codeaurora.org>
parent c585956b
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -1005,6 +1005,7 @@ void wil_netif_rx_any(struct sk_buff *skb, struct net_device *ndev)
{
	int cid, security;
	struct wil6210_priv *wil = ndev_to_wil(ndev);
	struct wil6210_vif *vif = ndev_to_vif(ndev);
	struct wil_net_stats *stats;

	wil->txrx_ops.get_netif_rx_params(skb, &cid, &security);
@@ -1013,6 +1014,18 @@ void wil_netif_rx_any(struct sk_buff *skb, struct net_device *ndev)

	skb_orphan(skb);

	/* pass only EAPOL packets as plaintext */
	if (vif->privacy && !security &&
	    wil_skb_get_protocol(skb) != htons(ETH_P_PAE)) {
		wil_dbg_txrx(wil,
			     "Rx drop plaintext frame with %d bytes in secure network\n",
			     skb->len);
		dev_kfree_skb(skb);
		ndev->stats.rx_dropped++;
		stats->rx_dropped++;
		return;
	}

	if (security && (wil->txrx_ops.rx_crypto_check(wil, skb) != 0)) {
		dev_kfree_skb(skb);
		ndev->stats.rx_dropped++;