aboutsummaryrefslogtreecommitdiff
path: root/include/rdma/rdma_cm_ib.h
diff options
context:
space:
mode:
authorAlexei Starovoitov <ast@plumgrid.com>2013-11-19 19:12:34 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-12-08 07:29:26 -0800
commit62713c4b6bc10c2d082ee1540e11b01a2b2162ab (patch)
tree0c6232d64c58c883c2db4289c9066826861fb574 /include/rdma/rdma_cm_ib.h
parent8392415810ff70ffb61ed1d4dbe5672ce34de9a2 (diff)
ipv4: fix race in concurrent ip_route_input_slow()
[ Upstream commit dcdfdf56b4a6c9437fc37dbc9cee94a788f9b0c4 ] CPUs can ask for local route via ip_route_input_noref() concurrently. if nh_rth_input is not cached yet, CPUs will proceed to allocate equivalent DSTs on 'lo' and then will try to cache them in nh_rth_input via rt_cache_route() Most of the time they succeed, but on occasion the following two lines: orig = *p; prev = cmpxchg(p, orig, rt); in rt_cache_route() do race and one of the cpus fails to complete cmpxchg. But ip_route_input_slow() doesn't check the return code of rt_cache_route(), so dst is leaking. dst_destroy() is never called and 'lo' device refcnt doesn't go to zero, which can be seen in the logs as: unregister_netdevice: waiting for lo to become free. Usage count = 1 Adding mdelay() between above two lines makes it easily reproducible. Fix it similar to nh_pcpu_rth_output case. Fixes: d2d68ba9fe8b ("ipv4: Cache input routes in fib_info nexthops.") Signed-off-by: Alexei Starovoitov <ast@plumgrid.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/rdma/rdma_cm_ib.h')
0 files changed, 0 insertions, 0 deletions