nl80211: clear skb cb before passing to netlink
authorJohannes Berg <johannes.berg@intel.com>
Wed, 30 Jul 2014 12:55:26 +0000 (14:55 +0200)
committerBen Hutchings <ben@decadent.org.uk>
Wed, 5 Nov 2014 20:27:44 +0000 (20:27 +0000)
commita93db944b6250d4345ed30095001f8bee5ecaed7
treed67f0617c259b84ddec65cb9ce7e225e99abfaaf
parentb2d0a271e3785900eaef4d02d0c7c86a01a9f25b
nl80211: clear skb cb before passing to netlink

commit bd8c78e78d5011d8111bc2533ee73b13a3bd6c42 upstream.

In testmode and vendor command reply/event SKBs we use the
skb cb data to store nl80211 parameters between allocation
and sending. This causes the code for CONFIG_NETLINK_MMAP
to get confused, because it takes ownership of the skb cb
data when the SKB is handed off to netlink, and it doesn't
explicitly clear it.

Clear the skb cb explicitly when we're done and before it
gets passed to netlink to avoid this issue.

Reported-by: Assaf Azulay <assaf.azulay@intel.com>
Reported-by: David Spinadel <david.spinadel@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
net/wireless/nl80211.c