xfrm: Fix acquire state insertion.
Subsystems (3)
Steffen Klassert
maintainerPATCH 1/1 xfrm: Fix acquire state insertion.
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 0045e3d80613 ("xfrm: Cache used outbound xfrm states at the policy.")
Reported-by Dan Carpenter <[email protected]>
Signed-off-by Steffen Klassert <[email protected]>
--- net/xfrm/xfrm_state.c | 1 + 1 file changed, 1 insertion(+)
net/xfrm/xfrm_state.c +1 -0
@@ -1470,6 +1470,7 @@ xfrm_state_find(const xfrm_address_t *daddr, const xfrm_address_t *saddr, 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);
Signature · 1 line
2.34.1
Quoted 7 lines · Steffen Klassert
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 0045e3d80613 ("xfrm: Cache used outbound xfrm states at the policy.")Reported-by Dan Carpenter <[email protected]>Signed-off-by Steffen Klassert <[email protected]>
Reviewed-by Simon Horman <[email protected]>
Steffen Klassert
maintainerQuoted 10 lines · Simon Horman
Quoted 7 lines · Steffen Klassert
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 0045e3d80613 ("xfrm: Cache used outbound xfrm states at the policy.")Reported-by Dan Carpenter <[email protected]>Signed-off-by Steffen Klassert <[email protected]>Reviewed-by Simon Horman <[email protected]>
This is now applied to ipsec-next. Thanks for the review Simon!