linux-stable/net/core
roy.qing.li@gmail.com e049f28883 neigh: fix rcu splat in neigh_update()
when use dst_get_neighbour to get neighbour, we need
rcu_read_lock to protect, since dst_get_neighbour uses
rcu_dereference.

The bug was reported by Ari Savolainen <ari.m.savolainen@gmail.com>

[  105.612095]
[  105.612096] ===================================================
[  105.612100] [ INFO: suspicious rcu_dereference_check() usage. ]
[  105.612101] ---------------------------------------------------
[  105.612103] include/net/dst.h:91 invoked rcu_dereference_check()
without protection!
[  105.612105]
[  105.612106] other info that might help us debug this:
[  105.612106]
[  105.612108]
[  105.612108] rcu_scheduler_active = 1, debug_locks = 0
[  105.612110] 1 lock held by dnsmasq/2618:
[  105.612111]  #0:  (rtnl_mutex){+.+.+.}, at: [<ffffffff815df8c7>]
rtnl_lock+0x17/0x20
[  105.612120]
[  105.612121] stack backtrace:
[  105.612123] Pid: 2618, comm: dnsmasq Not tainted 3.1.0-rc1 #41
[  105.612125] Call Trace:
[  105.612129]  [<ffffffff810ccdcb>] lockdep_rcu_dereference+0xbb/0xc0
[  105.612132]  [<ffffffff815dc5a9>] neigh_update+0x4f9/0x5f0
[  105.612135]  [<ffffffff815da001>] ? neigh_lookup+0xe1/0x220
[  105.612139]  [<ffffffff81639298>] arp_req_set+0xb8/0x230
[  105.612142]  [<ffffffff8163a59f>] arp_ioctl+0x1bf/0x310
[  105.612146]  [<ffffffff810baa40>] ? lock_hrtimer_base.isra.26+0x30/0x60
[  105.612150]  [<ffffffff8163fb75>] inet_ioctl+0x85/0x90
[  105.612154]  [<ffffffff815b5520>] sock_do_ioctl+0x30/0x70
[  105.612157]  [<ffffffff815b55d3>] sock_ioctl+0x73/0x280
[  105.612162]  [<ffffffff811b7698>] do_vfs_ioctl+0x98/0x570
[  105.612165]  [<ffffffff811a5c40>] ? fget_light+0x340/0x3a0
[  105.612168]  [<ffffffff811b7bbf>] sys_ioctl+0x4f/0x80
[  105.612172]  [<ffffffff816fdcab>] system_call_fastpath+0x16/0x1b

Reported-by: Ari Savolainen <ari.m.savolainen@gmail.com>
Signed-off-by: RongQing <roy.qing.li@gmail.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2011-10-19 19:38:51 -04:00
..
datagram.c net: add skb frag size accessors 2011-10-19 03:10:46 -04:00
dev.c net: validate HWTSTAMP ioctl parameters 2011-10-19 17:00:35 -04:00
dev_addr_lists.c net: remove ndo_set_multicast_list callback 2011-08-17 20:22:03 -07:00
drop_monitor.c net,rcu: convert call_rcu(free_dm_hw_stat) to kfree_rcu() 2011-05-07 22:50:59 -07:00
dst.c net: fix potential neighbour race in dst_ifdown() 2011-08-09 21:47:14 -07:00
ethtool.c net: consolidate and fix ethtool_ops->get_settings calling 2011-09-15 17:32:26 -04:00
fib_rules.c Merge branch 'master' of github.com:davem330/net 2011-09-22 03:23:13 -04:00
filter.c filter: use unsigned int to silence static checker warning 2011-10-19 19:35:51 -04:00
flow.c net/flow: Fix potential memory leak 2011-10-17 19:18:42 -04:00
gen_estimator.c net,rcu: convert call_rcu(__gen_kill_estimator) to kfree_rcu() 2011-05-07 22:50:57 -07:00
gen_stats.c
iovec.c
kmap_skb.h net: convert core to skb paged frag APIs 2011-08-24 17:52:11 -07:00
link_watch.c net: linkwatch: allow vlans to get carrier changes faster 2011-09-15 15:36:34 -04:00
Makefile net: Compute protocol sequence numbers and fragment IDs using MD5. 2011-08-06 18:33:19 -07:00
neighbour.c neigh: fix rcu splat in neigh_update() 2011-10-19 19:38:51 -04:00
net-sysfs.c net: consolidate and fix ethtool_ops->get_settings calling 2011-09-15 17:32:26 -04:00
net-sysfs.h
net-traces.c core: add tracepoints for queueing skb to rcvbuf 2011-06-21 16:06:10 -07:00
net_namespace.c rtnl: provide link dump consistency info 2011-07-01 15:39:53 -07:00
netevent.c
netpoll.c Merge branch 'master' of github.com:davem330/net 2011-09-22 03:23:13 -04:00
pktgen.c net: add skb frag size accessors 2011-10-19 03:10:46 -04:00
request_sock.c
rtnetlink.c if_link: Add additional parameter to IFLA_VF_INFO for spoof checking 2011-10-16 13:15:38 -07:00
scm.c af_unix: dont send SCM_CREDENTIALS by default 2011-09-28 13:29:50 -04:00
secure_seq.c net: Compute protocol sequence numbers and fragment IDs using MD5. 2011-08-06 18:33:19 -07:00
skbuff.c net: Allow skb_recycle_check to be done in stages 2011-10-19 15:59:45 -04:00
sock.c net: more accurate skb truesize 2011-10-13 16:05:07 -04:00
stream.c
sysctl_net_core.c net: Kill ratelimit.h dependency in linux/net.h 2011-05-27 13:41:33 -04:00
timestamping.c net: export the receive time stamping hook for non-NAPI drivers 2011-06-20 13:56:53 -07:00
user_dma.c net: add skb frag size accessors 2011-10-19 03:10:46 -04:00
utils.c net: Kill ratelimit.h dependency in linux/net.h 2011-05-27 13:41:33 -04:00