mac80211: initialize fast-xmit 'info' later
authorJohannes Berg <johannes.berg@intel.com>
Mon, 2 Jan 2017 10:19:29 +0000 (11:19 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Jan 2017 10:22:43 +0000 (11:22 +0100)
commit9b73f43fcef40fa2bc8ceacbffdf040036bf891b
tree8e54e0eafbf1084c3f1628b508f0abaa51ee3efe
parent6e28a02f0e86453f50481d602522ef7d6463a344
mac80211: initialize fast-xmit 'info' later

commit 35f432a03e41d3bf08c51ede917f94e2288fbe8c upstream.

In ieee80211_xmit_fast(), 'info' is initialized to point to the skb
that's passed in, but that skb may later be replaced by a clone (if
it was shared), leading to an invalid pointer.

This can lead to use-after-free and also later crashes since the
real SKB's info->hw_queue doesn't get initialized properly.

Fix this by assigning info only later, when it's needed, after the
skb replacement (may have) happened.

Reported-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/mac80211/tx.c