Commit d0dcaa8d authored by Dan Carpenter's avatar Dan Carpenter Committed by Greg Kroah-Hartman

Staging: rtl8192e: pointer math bug in rtllib_rx_DELBA()

The pointer math here was totally wrong so we were reading nonsense
information from beyond the end of the buffer.  It could lead to an oops
if that memory wasn't mapped.

The "pReasonCode" pointer is assigned but never used so I deleted it.

With-Fix-From: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Acked-by: default avatarMateusz Kulikowski <mateusz.kulikowski@gmail.com>
Tested-by: default avatarMateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 2ee4c3dc
...@@ -428,7 +428,6 @@ int rtllib_rx_DELBA(struct rtllib_device *ieee, struct sk_buff *skb) ...@@ -428,7 +428,6 @@ int rtllib_rx_DELBA(struct rtllib_device *ieee, struct sk_buff *skb)
{ {
struct rtllib_hdr_3addr *delba = NULL; struct rtllib_hdr_3addr *delba = NULL;
union delba_param_set *pDelBaParamSet = NULL; union delba_param_set *pDelBaParamSet = NULL;
u16 *pReasonCode = NULL;
u8 *dst = NULL; u8 *dst = NULL;
if (skb->len < sizeof(struct rtllib_hdr_3addr) + 6) { if (skb->len < sizeof(struct rtllib_hdr_3addr) + 6) {
...@@ -453,9 +452,7 @@ int rtllib_rx_DELBA(struct rtllib_device *ieee, struct sk_buff *skb) ...@@ -453,9 +452,7 @@ int rtllib_rx_DELBA(struct rtllib_device *ieee, struct sk_buff *skb)
#endif #endif
delba = (struct rtllib_hdr_3addr *)skb->data; delba = (struct rtllib_hdr_3addr *)skb->data;
dst = (u8 *)(&delba->addr2[0]); dst = (u8 *)(&delba->addr2[0]);
delba += sizeof(struct rtllib_hdr_3addr); pDelBaParamSet = (union delba_param_set *)&delba->payload[2];
pDelBaParamSet = (union delba_param_set *)(delba+2);
pReasonCode = (u16 *)(delba+4);
if (pDelBaParamSet->field.Initiator == 1) { if (pDelBaParamSet->field.Initiator == 1) {
struct rx_ts_record *pRxTs; struct rx_ts_record *pRxTs;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment