]> git.baikalelectronics.ru Git - kernel.git/commit
neighbour: fix a race in neigh_destroy()
authorEric Dumazet <eric.dumazet@gmail.com>
Fri, 28 Jun 2013 09:37:42 +0000 (02:37 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 1 Jul 2013 20:35:32 +0000 (13:35 -0700)
commit9293ac9d019b9d3c8433170a65afea3d6df518d3
tree6bbd193b81267981efecbd296c39e197e15f0ced
parent0da14a5cfaddf276e0aafcf88b9c902d887b2f36
neighbour: fix a race in neigh_destroy()

There is a race in neighbour code, because neigh_destroy() uses
skb_queue_purge(&neigh->arp_queue) without holding neighbour lock,
while other parts of the code assume neighbour rwlock is what
protects arp_queue

Convert all skb_queue_purge() calls to the __skb_queue_purge() variant

Use __skb_queue_head_init() instead of skb_queue_head_init()
to make clear we do not use arp_queue.lock

And hold neigh->lock in neigh_destroy() to close the race.

Reported-by: Joe Jin <joe.jin@oracle.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/neighbour.c