kernel-ark/net/core
Julian Anastasov 2c51a97f76 neigh: do not modify unlinked entries
The lockless lookups can return entry that is unlinked.
Sometimes they get reference before last neigh_cleanup_and_release,
sometimes they do not need reference. Later, any
modification attempts may result in the following problems:

1. entry is not destroyed immediately because neigh_update
can start the timer for dead entry, eg. on change to NUD_REACHABLE
state. As result, entry lives for some time but is invisible
and out of control.

2. __neigh_event_send can run in parallel with neigh_destroy
while refcnt=0 but if timer is started and expired refcnt can
reach 0 for second time leading to second neigh_destroy and
possible crash.

Thanks to Eric Dumazet and Ying Xue for their work and analyze
on the __neigh_event_send change.

Fixes: 767e97e1e0 ("neigh: RCU conversion of struct neighbour")
Fixes: a263b30936 ("ipv4: Make neigh lookups directly in output packet path.")
Fixes: 6fd6ce2056 ("ipv6: Do not depend on rt->n in ip6_finish_output2().")
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Ying Xue <ying.xue@windriver.com>
Signed-off-by: Julian Anastasov <ja@ssi.bg>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2015-06-21 09:43:40 -07:00
..
datagram.c new helper: msg_data_left() 2015-04-11 15:53:35 -04:00
dev_addr_lists.c
dev_ioctl.c
dev.c net: replace last open coded skb_orphan_frags with function call 2015-06-08 12:15:13 -07:00
drop_monitor.c
dst.c
ethtool.c Revert "net: core: 'ethtool' issue with querying phy settings" 2015-06-01 14:43:50 -07:00
fib_rules.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2015-04-06 22:34:15 -04:00
filter.c bpf: fix bpf helpers to use skb->mac_header relative offsets 2015-04-16 14:08:49 -04:00
flow_dissector.c
flow.c
gen_estimator.c
gen_stats.c gen_stats.c: Duplicate xstats buffer for later use 2015-02-19 15:45:53 -05:00
link_watch.c dev: introduce dev_get_iflink() 2015-04-02 14:04:59 -04:00
Makefile
neighbour.c neigh: do not modify unlinked entries 2015-06-21 09:43:40 -07:00
net_namespace.c netns: return RTM_NEWNSID instead of RTM_GETNSID on a get 2015-05-12 18:53:25 -04:00
net-procfs.c
net-sysfs.c dev: introduce dev_get_iflink() 2015-04-02 14:04:59 -04:00
net-sysfs.h
net-traces.c
netclassid_cgroup.c
netevent.c
netpoll.c
netprio_cgroup.c
pktgen.c net: pktgen: disable xmit_clone on virtual devices 2015-02-22 22:43:20 -05:00
ptp_classifier.c
request_sock.c net: convert syn_wait_lock to a spinlock 2015-03-23 16:52:26 -04:00
rtnetlink.c rtnl/bond: don't send rtnl msg for unregistered iface 2015-05-17 22:43:07 -04:00
scm.c
secure_seq.c
skbuff.c net: don't wait for order-3 page allocation 2015-06-11 17:33:44 -07:00
sock_diag.c net: add real socket cookies 2015-03-11 21:55:28 -04:00
sock.c net: don't wait for order-3 page allocation 2015-06-11 17:33:44 -07:00
stream.c
sysctl_net_core.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2015-03-20 18:51:09 -04:00
timestamping.c
tso.c
utils.c