[XFRM]: Fix potential race vs xfrm_state(only)_find and xfrm_hash_resize.
authorPavel Emelyanov <xemul@openvz.org>
Fri, 14 Dec 2007 19:38:04 +0000 (11:38 -0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 28 Jan 2008 22:58:07 +0000 (14:58 -0800)
commit4bda4f250d21c3e4f2a2da5f4cef829a434a4046
tree2632bc368ceab622cf119ef5aee154617fe43f1c
parent5e41fb83216d370d158fe17675af82d12c6c72c9
[XFRM]: Fix potential race vs xfrm_state(only)_find and xfrm_hash_resize.

The _find calls calculate the hash value using the
xfrm_state_hmask, without the xfrm_state_lock. But the
value of this mask can change in the _resize call under
the state_lock, so we risk to fail in finding the desired
entry in hash.

I think, that the hash value is better to calculate
under the state lock.

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