[PATCH] mac80211: fix iff_promiscs, iff_allmultis race
authorJohannes Berg <johannes@sipsolutions.net>
Wed, 26 Sep 2007 13:19:47 +0000 (15:19 +0200)
committerDavid S. Miller <davem@sunset.davemloft.net>
Wed, 10 Oct 2007 23:53:16 +0000 (16:53 -0700)
commit53918994b7c8c3bf0af5f641e1f299856799d883
tree63338872613d3c08473acfb46c8a57490f85350b
parent50741ae05a4742cae99361f57d84b5f8d33822a4
[PATCH] mac80211: fix iff_promiscs, iff_allmultis race

When we update the counters iff_promiscs and iff_allmultis
in struct ieee80211_local we have no common lock held to
protect them. The problem is that the update to each counter
may not be atomic, so we could end up with iff_promiscs == -1
in unfortunate conditions. To fix it, use atomic_t values.
It doesn't matter whether the two counters are updated
together atomically or not, if there are two invocations
of set_multicast_list we will end up with multiple
configure_filter() invocations of which the latter will always
be correct.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
net/mac80211/ieee80211.c
net/mac80211/ieee80211_i.h
net/mac80211/rx.c
This page took 0.030435 seconds and 5 git commands to generate.