xfrm: Fix acquire state insertion.
commita35672819fupstream. A recent commit jumped over the dst hash computation and left the symbol uninitialized. Fix this by explicitly computing the dst hash before it is used. Fixes:0045e3d806("xfrm: Cache used outbound xfrm states at the policy.") Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Simon Horman <horms@kernel.org> Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
78b366aa0e
commit
364d7e7f30
@@ -1512,6 +1512,7 @@ found:
|
||||
x->km.state = XFRM_STATE_ACQ;
|
||||
x->dir = XFRM_SA_DIR_OUT;
|
||||
list_add(&x->km.all, &net->xfrm.state_all);
|
||||
h = xfrm_dst_hash(net, daddr, saddr, tmpl->reqid, encap_family);
|
||||
XFRM_STATE_INSERT(bydst, &x->bydst,
|
||||
net->xfrm.state_bydst + h,
|
||||
x->xso.type);
|
||||
|
||||
Reference in New Issue
Block a user