linux/net
Johannes Berg a160ee69c6 wext: let get_wireless_stats() sleep
A number of drivers (recently including cfg80211-based ones)
assume that all wireless handlers, including statistics, can
sleep and they often also implicitly assume that the rtnl is
held around their invocation. This is almost always true now
except when reading from sysfs:

  BUG: sleeping function called from invalid context at kernel/mutex.c:280
  in_atomic(): 1, irqs_disabled(): 0, pid: 10450, name: head
  2 locks held by head/10450:
   #0:  (&buffer->mutex){+.+.+.}, at: [<c10ceb99>] sysfs_read_file+0x24/0xf4
   #1:  (dev_base_lock){++.?..}, at: [<c12844ee>] wireless_show+0x1a/0x4c
  Pid: 10450, comm: head Not tainted 2.6.32-rc3 #1
  Call Trace:
   [<c102301c>] __might_sleep+0xf0/0xf7
   [<c1324355>] mutex_lock_nested+0x1a/0x33
   [<f8cea53b>] wdev_lock+0xd/0xf [cfg80211]
   [<f8cea58f>] cfg80211_wireless_stats+0x45/0x12d [cfg80211]
   [<c13118d6>] get_wireless_stats+0x16/0x1c
   [<c12844fe>] wireless_show+0x2a/0x4c

Fix this by using the rtnl instead of dev_base_lock.

Reported-by: Miles Lane <miles.lane@gmail.com>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-05 02:22:23 -07:00
..
9p virtio: add virtio IDs file 2009-09-23 22:26:32 +09:30
802
8021q net: fix vlan_get_size to include vlan_flags size 2009-09-26 20:16:07 -07:00
appletalk Have atalk_route_packet() return NET_RX_SUCCESS not NET_XMIT_SUCCESS 2009-09-14 17:02:47 -07:00
atm net: Make setsockopt() optlen be unsigned. 2009-09-30 16:12:20 -07:00
ax25 ax25: Fix possible oops in ax25_make_new 2009-09-30 16:44:12 -07:00
bluetooth net: Make setsockopt() optlen be unsigned. 2009-09-30 16:12:20 -07:00
bridge bridge: Fix double-free in br_add_if. 2009-09-28 12:54:25 -07:00
can net: Make setsockopt() optlen be unsigned. 2009-09-30 16:12:20 -07:00
core wext: let get_wireless_stats() sleep 2009-10-05 02:22:23 -07:00
dcb net: fix double skb free in dcbnl 2009-09-26 20:16:15 -07:00
dccp net: Make setsockopt() optlen be unsigned. 2009-09-30 16:12:20 -07:00
decnet net: Make setsockopt() optlen be unsigned. 2009-09-30 16:12:20 -07:00
dsa
econet
ethernet
ieee802154 net: Make setsockopt() optlen be unsigned. 2009-09-30 16:12:20 -07:00
ipv4 net: splice() from tcp to pipe should take into account O_NONBLOCK 2009-10-02 09:46:05 -07:00
ipv6 sit: fix off-by-one in ipip6_tunnel_get_prl 2009-09-30 16:39:27 -07:00
ipx net: Make setsockopt() optlen be unsigned. 2009-09-30 16:12:20 -07:00
irda net: Make setsockopt() optlen be unsigned. 2009-09-30 16:12:20 -07:00
iucv net: Make setsockopt() optlen be unsigned. 2009-09-30 16:12:20 -07:00
key net: file_operations should be const 2009-09-02 01:03:53 -07:00
lapb
llc net: Make setsockopt() optlen be unsigned. 2009-09-30 16:12:20 -07:00
mac80211 mac80211: Fix [re]association power saving issue on AP side 2009-09-29 17:25:15 -04:00
netfilter net: Make setsockopt() optlen be unsigned. 2009-09-30 16:12:20 -07:00
netlabel
netlink net: Make setsockopt() optlen be unsigned. 2009-09-30 16:12:20 -07:00
netrom net: Make setsockopt() optlen be unsigned. 2009-09-30 16:12:20 -07:00
packet net: Make setsockopt() optlen be unsigned. 2009-09-30 16:12:20 -07:00
phonet Phonet: fix mutex imbalance 2009-09-30 16:41:34 -07:00
rds net: Make setsockopt() optlen be unsigned. 2009-09-30 16:12:20 -07:00
rfkill
rose net: Make setsockopt() optlen be unsigned. 2009-09-30 16:12:20 -07:00
rxrpc net: Make setsockopt() optlen be unsigned. 2009-09-30 16:12:20 -07:00
sched trivial: fix typo "to to" in multiple files 2009-09-21 15:14:55 +02:00
sctp net: Make setsockopt() optlen be unsigned. 2009-09-30 16:12:20 -07:00
sunrpc net: fix htmldocs sunrpc, clnt.c 2009-09-24 15:39:14 -07:00
tipc net: Make setsockopt() optlen be unsigned. 2009-09-30 16:12:20 -07:00
unix net: unix: fix sending fds in multiple buffers 2009-09-11 11:31:45 -07:00
wanrouter
wimax
wireless wext: add back wireless/ dir in sysfs for cfg80211 interfaces 2009-09-28 16:55:07 -04:00
x25 net: Make setsockopt() optlen be unsigned. 2009-09-30 16:12:20 -07:00
xfrm net: file_operations should be const 2009-09-02 01:03:53 -07:00
Kconfig
Makefile
TUNABLE
compat.c net: Make setsockopt() optlen be unsigned. 2009-09-30 16:12:20 -07:00
nonet.c
socket.c net: Make setsockopt() optlen be unsigned. 2009-09-30 16:12:20 -07:00
sysctl_net.c