mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-14 00:24:41 -04:00
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: Ahmad Masri <amasri@codeaurora.org>
This commit is contained in:
parent
c55f25ffb3
commit
c993cbae6e
1 changed files with 13 additions and 0 deletions
|
|
@ -1002,6 +1002,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);
|
||||
|
|
@ -1010,6 +1011,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)) {
|
||||
wil_dbg_txrx(wil, "Rx drop %d bytes\n", skb->len);
|
||||
dev_kfree_skb(skb);
|
||||
|
|
|
|||
Loading…
Reference in a new issue