linux-kernel-test/net
David Woodhouse 08613e4626 caif: Fix BUG() with network namespaces
The caif code will register its own pernet_operations, and then register
a netdevice_notifier. Each time the netdevice_notifier is triggered,
it'll do some stuff... including a lookup of its own pernet stuff with
net_generic().

If the net_generic() call ever returns NULL, the caif code will BUG().
That doesn't seem *so* unreasonable, I suppose — it does seem like it
should never happen.

However, it *does* happen. When we clone a network namespace,
setup_net() runs through all the pernet_operations one at a time. It
gets to loopback before it gets to caif. And loopback_net_init()
registers a netdevice... while caif hasn't been initialised. So the caif
netdevice notifier triggers, and immediately goes BUG().

We could imagine a complex and overengineered solution to this generic
class of problems, but this patch takes the simple approach. It just
makes caif_device_notify() *not* go looking for its pernet data
structures if the device it's being notified about isn't a caif device
in the first place.

Cc: stable@kernel.org
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Acked-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2011-10-25 19:22:23 -04:00
..
9p net/9p: Fix kernel crash with msize 512K 2011-09-06 08:17:15 -05:00
802 rcu: convert uses of rcu_assign_pointer(x, NULL) to RCU_INIT_POINTER 2011-08-02 04:29:23 -07:00
8021q net: consolidate and fix ethtool_ops->get_settings calling 2011-09-15 17:32:26 -04:00
appletalk net: add skb frag size accessors 2011-10-19 03:10:46 -04:00
atm Merge branch 'master' of github.com:davem330/net 2011-09-22 03:23:13 -04:00
ax25
batman-adv Merge branch 'master' of ra.kernel.org:/pub/scm/linux/kernel/git/davem/net 2011-10-24 18:18:09 -04:00
bluetooth Merge branch 'master' of ra.kernel.org:/pub/scm/linux/kernel/git/davem/net 2011-10-24 18:18:09 -04:00
bridge Merge branch 'master' of ra.kernel.org:/pub/scm/linux/kernel/git/davem/net 2011-10-24 18:18:09 -04:00
caif caif: Fix BUG() with network namespaces 2011-10-25 19:22:23 -04:00
can can: remove references to berlios mailinglist 2011-10-17 19:22:46 -04:00
ceph Merge branch 'for-linus' of git://github.com/NewDreamNetwork/ceph-client 2011-09-29 19:58:58 -07:00
core net: Unlock sock before calling sk_free() 2011-10-25 19:17:25 -04:00
dcb dcb: add DCBX mode to event notifier attributes 2011-10-06 15:49:51 -04:00
dccp Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net 2011-08-07 23:20:26 -07:00
decnet rcu: convert uses of rcu_assign_pointer(x, NULL) to RCU_INIT_POINTER 2011-08-02 04:29:23 -07:00
dns_resolver
dsa net: remove use of ndo_set_multicast_list in drivers 2011-08-17 20:22:03 -07:00
econet
ethernet net: don't clear IFF_XMIT_DST_RELEASE in ether_setup 2011-09-15 14:49:44 -04:00
ieee802154 6LoWPAN: fix skb_copy call 2011-09-15 15:36:35 -04:00
ipv4 ipv4: avoid useless call of the function check_peer_pmtu 2011-10-24 18:30:07 -04:00
ipv6 ipv6: Do not use routes from locally generated RAs 2011-10-24 19:13:15 -04:00
ipx
irda Merge branch 'master' of github.com:davem330/net 2011-09-22 03:23:13 -04:00
iucv net: more accurate skb truesize 2011-10-13 16:05:07 -04:00
key
l2tp Merge branch 'master' of ra.kernel.org:/pub/scm/linux/kernel/git/davem/net 2011-10-24 18:18:09 -04:00
lapb wan: make LAPB callbacks const 2011-09-16 19:20:20 -04:00
llc
mac80211 Merge branch 'pm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm 2011-10-25 15:18:39 +02:00
netfilter Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2011-10-25 13:25:22 +02:00
netlabel Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net 2011-08-20 10:39:12 -07:00
netlink af_unix: dont send SCM_CREDENTIALS by default 2011-09-28 13:29:50 -04:00
netrom
nfc NFC: use after free on error 2011-09-27 14:34:10 -04:00
packet macvlan: handle fragmented multicast frames 2011-10-18 23:22:07 -04:00
phonet rcu: convert uses of rcu_assign_pointer(x, NULL) to RCU_INIT_POINTER 2011-08-02 04:29:23 -07:00
rds Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2011-10-25 13:25:22 +02:00
rfkill net:rfkill: add a gpio setup function into GPIO rfkill 2011-10-03 15:19:19 -04:00
rose
rxrpc
sched net_sched: cls_flow: use skb_header_pointer() 2011-10-24 18:40:14 -04:00
sctp net: more accurate skb truesize 2011-10-13 16:05:07 -04:00
sunrpc Merge branch 'nfs-for-3.2' of git://git.linux-nfs.org/projects/trondmy/linux-nfs 2011-10-25 15:44:06 +02:00
tipc tipc: Remove unused link event tracking code 2011-09-17 22:55:15 -04:00
unix af_unix: dont send SCM_CREDENTIALS by default 2011-09-28 13:29:50 -04:00
wanrouter
wimax
wireless nl80211: Add sta_flags to the station info 2011-10-14 14:48:23 -04:00
x25 x25: Prevent skb overreads when checking call user data 2011-10-17 19:31:40 -04:00
xfrm net: add skb frag size accessors 2011-10-19 03:10:46 -04:00
compat.c
Kconfig
Makefile
nonet.c
socket.c Merge branch 'master' of github.com:davem330/net 2011-09-22 03:23:13 -04:00
sysctl_net.c