staging: vt6656: Just check NEWRSR_DECRYPTOK for RX_FLAG_DECRYPTED.

At present the driver does a number of checks for RX_FLAG_DECRYPTED.

Remove all these and just pass check NEWRSR_DECRYPTOK mac80211
will handle the processing of the sk_buff and dispose of it.

This means that mac80211 can do unsupported encryption modes
on stack.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Link: https://lore.kernel.org/r/75bbaa08-2465-b057-64ce-b67933409bc6@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Malcolm Priestley 2020-01-19 12:04:05 +00:00 committed by Greg Kroah-Hartman
parent b653174327
commit 1ca9c73105
1 changed files with 2 additions and 16 deletions

View File

@ -30,10 +30,8 @@ int vnt_rx_data(struct vnt_private *priv, struct vnt_rcb *ptr_rcb,
struct ieee80211_supported_band *sband; struct ieee80211_supported_band *sband;
struct sk_buff *skb; struct sk_buff *skb;
struct ieee80211_rx_status *rx_status; struct ieee80211_rx_status *rx_status;
struct ieee80211_hdr *hdr;
struct vnt_rx_header *head; struct vnt_rx_header *head;
struct vnt_rx_tail *tail; struct vnt_rx_tail *tail;
__le16 fc;
u32 frame_size; u32 frame_size;
int ii; int ii;
u16 rx_bitrate, pay_load_with_padding; u16 rx_bitrate, pay_load_with_padding;
@ -115,22 +113,10 @@ int vnt_rx_data(struct vnt_private *priv, struct vnt_rcb *ptr_rcb,
if (!(tail->rsr & RSR_CRCOK)) if (!(tail->rsr & RSR_CRCOK))
rx_status->flag |= RX_FLAG_FAILED_FCS_CRC; rx_status->flag |= RX_FLAG_FAILED_FCS_CRC;
hdr = (struct ieee80211_hdr *)(skb->data);
fc = hdr->frame_control;
rx_status->rate_idx = rate_idx; rx_status->rate_idx = rate_idx;
if (ieee80211_has_protected(fc)) { if (tail->new_rsr & NEWRSR_DECRYPTOK)
if (priv->local_id > REV_ID_VT3253_A1) { rx_status->flag |= RX_FLAG_DECRYPTED;
rx_status->flag |= RX_FLAG_DECRYPTED;
/* Drop packet */
if (!(tail->new_rsr & NEWRSR_DECRYPTOK)) {
dev_kfree_skb(skb);
return true;
}
}
}
ieee80211_rx_irqsafe(priv->hw, skb); ieee80211_rx_irqsafe(priv->hw, skb);