]> git.baikalelectronics.ru Git - kernel.git/commit
inetpeer: fix a race in inetpeer_gc_worker()
authorEric Dumazet <edumazet@google.com>
Tue, 5 Jun 2012 03:00:18 +0000 (03:00 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 6 Jun 2012 17:45:15 +0000 (10:45 -0700)
commitaa600deff85e702a72eb9183d643ca114a8952ed
treef830eb5150e38be149fcfce74f68716f5bf2641a
parent73cc3b5803a32f154e389534fd59a114d394ec50
inetpeer: fix a race in inetpeer_gc_worker()

commit 0e7df0bb10b6b1 (inetpeer: Invalidate the inetpeer tree along with
the routing cache) added a race :

Before freeing an inetpeer, we must respect a RCU grace period, and make
sure no user will attempt to increase refcnt.

inetpeer_invalidate_tree() waits for a RCU grace period before inserting
inetpeer tree into gc_list and waking the worker. At that time, no
concurrent lookup can find a inetpeer in this tree.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Steffen Klassert <steffen.klassert@secunet.com>
Acked-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/inetpeer.h
net/ipv4/inetpeer.c