diff options
author | Ivan Safonov <insafonov@gmail.com> | 2017-05-02 09:01:42 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-05-15 07:41:59 +0200 |
commit | 79650ffde38ec4dd8f5c39ff0a305fb0bc1bb142 (patch) | |
tree | e6cbdd9a65c239fa224af90bbb6f895e618049d8 /drivers/staging/rtl8188eu/os_dep | |
parent | 02b19b4c4920cf7976828216b36f0f2317aa20be (diff) | |
download | op-kernel-dev-79650ffde38ec4dd8f5c39ff0a305fb0bc1bb142.zip op-kernel-dev-79650ffde38ec4dd8f5c39ff0a305fb0bc1bb142.tar.gz |
staging:r8188eu: trim IV/ICV fields in validate_recv_data_frame()
Length of IV/ICV fields calculated here, so trim these field here too.
Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rtl8188eu/os_dep')
-rw-r--r-- | drivers/staging/rtl8188eu/os_dep/mon.c | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/drivers/staging/rtl8188eu/os_dep/mon.c b/drivers/staging/rtl8188eu/os_dep/mon.c index 53f853f..ed39661 100644 --- a/drivers/staging/rtl8188eu/os_dep/mon.c +++ b/drivers/staging/rtl8188eu/os_dep/mon.c @@ -67,7 +67,7 @@ static void mon_recv_decrypted(struct net_device *dev, const u8 *data, } static void mon_recv_decrypted_recv(struct net_device *dev, const u8 *data, - int data_len, int iv_len, int icv_len) + int data_len) { struct sk_buff *skb; struct ieee80211_hdr *hdr; @@ -86,15 +86,8 @@ static void mon_recv_decrypted_recv(struct net_device *dev, const u8 *data, hdr = (struct ieee80211_hdr *)skb->data; hdr_len = ieee80211_hdrlen(hdr->frame_control); - if (skb->len < hdr_len + iv_len + icv_len) { - if (ieee80211_has_protected(hdr->frame_control)) { - hdr->frame_control &= ~cpu_to_le16(IEEE80211_FCTL_PROTECTED); - - memmove(skb->data + iv_len, skb->data, hdr_len); - skb_pull(skb, iv_len); - skb_trim(skb, skb->len - icv_len); - } - } + if (ieee80211_has_protected(hdr->frame_control)) + hdr->frame_control &= ~cpu_to_le16(IEEE80211_FCTL_PROTECTED); skb->ip_summed = CHECKSUM_UNNECESSARY; skb->protocol = eth_type_trans(skb, dev); @@ -117,7 +110,6 @@ static void mon_recv_encrypted(struct net_device *dev, const u8 *data, void rtl88eu_mon_recv_hook(struct net_device *dev, struct recv_frame *frame) { struct rx_pkt_attrib *attr; - int iv_len, icv_len; int data_len; u8 *data; @@ -130,11 +122,8 @@ void rtl88eu_mon_recv_hook(struct net_device *dev, struct recv_frame *frame) data = frame->pkt->data; data_len = frame->pkt->len; - /* Broadcast and multicast frames don't have attr->{iv,icv}_len set */ - SET_ICE_IV_LEN(iv_len, icv_len, attr->encrypt); - if (attr->bdecrypted) - mon_recv_decrypted_recv(dev, data, data_len, iv_len, icv_len); + mon_recv_decrypted_recv(dev, data, data_len); else mon_recv_encrypted(dev, data, data_len); } |