Staging: rtl8192u: pointer math bug in ieee80211_rx_DELBA()
authorDan Carpenter <dan.carpenter@oracle.com>
Sun, 19 Jul 2015 10:52:17 +0000 (13:52 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 23 Jul 2015 04:03:04 +0000 (21:03 -0700)
commit047db9915ed576e817eb02c1d1cf037c49856b59
tree8095b79bc27f82f2ec8f86eb20079f1425d978ab
parent0a32bd33ed3e03258e255a5b580ce7b3f514763e
Staging: rtl8192u: pointer math bug in ieee80211_rx_DELBA()

Smatch complains because "delba" is a pointer to struct
rtl_80211_hdr_3addr so the "delba += sizeof(struct rtl_80211_hdr_3addr);"
is clearly wrong.  We are reading nonsense data from beyond the end of
the buffer and could oops if that memory isn't mapped.

It turns out the next two statements are also wrong. We should delete
the += sizeof() statement and "delba+2" should be "&delba->payload[2]".
"pReasonCode" isn't used so I deleted that.

With-Fix-From: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c