mac80211: fix use-after-free in defragmentation
authorJohannes Berg <johannes.berg@intel.com>
Mon, 3 Nov 2014 12:57:46 +0000 (13:57 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 Nov 2014 17:22:53 +0000 (09:22 -0800)
commit2e613ff8d8221da89904473a8136ee29efeca6f0
tree7a032f457c18d8ba709426dcad2922a4390d2ede
parentb34fafa32078fec415d2d5ec2361fc3b072351cf
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/mac80211/rx.c