nl80211: fix another nl80211_fam.attrbuf race
authorJohannes Berg <johannes.berg@intel.com>
Tue, 30 Jul 2013 20:34:28 +0000 (22:34 +0200)
committerDmitry Shmidt <dimitrysh@google.com>
Tue, 17 Jun 2014 00:34:52 +0000 (17:34 -0700)
commit36cafd21673f7a50bc1c29b25530b5b715ec36bd
tree21ef0e866f699399fb6fed8bc5f52da60614c34f
parent8ae872f1d59990a1f33a7e5aae6b5bcbedc5806f
nl80211: fix another nl80211_fam.attrbuf race

commit c319d50bfcf678c2857038276d9fab3c6646f3bf upstream.

This is similar to the race Linus had reported, but in this case
it's an older bug: nl80211_prepare_wdev_dump() uses the wiphy
index in cb->args[0] as it is and thus parses the message over
and over again instead of just once because 0 is the first valid
wiphy index. Similar code in nl80211_testmode_dump() correctly
offsets the wiphy_index by 1, do that here as well.

Reported-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/wireless/nl80211.c