diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2009-05-11 16:06:36 +0200 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-05-11 15:24:07 -0400 |
commit | 7be69c0b9aa93ef655db4d46e5654996489d62f5 (patch) | |
tree | ae00a8c366c7cb3d8aad35acc9b16f8e2d355b02 /net/appletalk | |
parent | e80cf8537ae54ec96c389055d6e9b0ef630c042d (diff) |
wext: fix get_wireless_stats locking
Currently, get_wireless_stats is racy by _design_. This is
because it returns a buffer, which needs to be statically
allocated since it cannot be freed if it was allocated
dynamically. Also, SIOCGIWSTATS and /proc/net/wireless use
no common lock, and /proc/net/wireless accesses are not
synchronised against each other. This is a design flaw in
get_wireless_stats since the beginning.
This patch fixes it by wrapping /proc/net/wireless accesses
with the RTNL so they are protected against each other and
SIOCGIWSTATS. The more correct method of fixing this would
be to pass in the buffer instead of returning it and have
the caller take care of synchronisation of the buffer, but
even then most drivers probably assume that their callback
is protected by the RTNL like all other wext callbacks.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/appletalk')
0 files changed, 0 insertions, 0 deletions