mac80211: fix use-after-free in defragmentation
authorJohannes Berg <johannes.berg@intel.com>
Mon, 3 Nov 2014 12:57:46 +0000 (13:57 +0100)
committerZefan Li <lizefan@huawei.com>
Mon, 2 Feb 2015 09:05:18 +0000 (17:05 +0800)
commit17ee0a10c12204dab58922c25823fc7efe1dc4b6
tree24b77a2eaceee06bedeca81e077b88fdab64444d
parent14194d6c2736eb1129579814dabb6e1751c7c964
mac80211: fix use-after-free in defragmentation

commit b8fff407a180286aa683d543d878d98d9fc57b13 upstream.

Upon receiving the last fragment, all but the first fragment
are freed, but the multicast check for statistics at the end
of the function refers to the current skb (the last fragment)
causing a use-after-free bug.

Since multicast frames cannot be fragmented and we check for
this early in the function, just modify that check to also
do the accounting to fix the issue.

Reported-by: Yosef Khyal <yosefx.khyal@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Zefan Li <lizefan@huawei.com>
net/mac80211/rx.c