[NEIGH]: Fix race between neighbor lookup and table's hash_rnd update.
authorPavel Emelyanov <xemul@openvz.org>
Sun, 24 Feb 2008 03:57:02 +0000 (19:57 -0800)
committerDavid S. Miller <davem@davemloft.net>
Sun, 24 Feb 2008 03:57:02 +0000 (19:57 -0800)
The neigh_hash_grow() may update the tbl->hash_rnd value, which
is used in all tbl->hash callbacks to calculate the hashval.

Two lookup routines may race with this, since they call the
->hash callback without the tbl->lock held. Since the hash_rnd
is changed with this lock write-locked moving the calls to ->hash
under this lock read-locked closes this gap.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>

No differences found