]> git.baikalelectronics.ru Git - kernel.git/commit
[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)
commit94d019ce5193e314dfee8389d17345e66b2be5e1
tree44c9dab22f5d75d797845b54df07bd6da40bcc7e
parentc07ff459787e10ba3543ac852c795009f289356d
[NEIGH]: Fix race between neighbor lookup and table's hash_rnd update.

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>
net/core/neighbour.c