xfrm: fix a race in xfrm_state_lookup_byspi
authorLi RongQing <roy.qing.li@gmail.com>
Wed, 29 Apr 2015 00:42:44 +0000 (08:42 +0800)
committerSteffen Klassert <steffen.klassert@secunet.com>
Wed, 29 Apr 2015 11:53:46 +0000 (13:53 +0200)
commitbdddbf6996c0b9299efc97b8f66e06286f3aa8c9
tree504d61ae096e3b3e4272b877638b49db2d33da22
parent39376ccb1968ba9f83e2a880a8bf02ad5dea44e1
xfrm: fix a race in xfrm_state_lookup_byspi

The returned xfrm_state should be hold before unlock xfrm_state_lock,
otherwise the returned xfrm_state maybe be released.

Fixes: c454997e6[{pktgen, xfrm} Introduce xfrm_state_lookup_byspi..]
Cc: Fan Du <fan.du@intel.com>
Signed-off-by: Li RongQing <roy.qing.li@gmail.com>
Acked-by: Fan Du <fan.du@intel.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
net/xfrm/xfrm_state.c