Skip to content

Commit c51bb2f

Browse files
klassertmehmetb0
authored andcommitted
xfrm: Fix acquire state insertion.
BugLink: https://bugs.launchpad.net/bugs/2111953 commit a356728 upstream. 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: 0045e3d ("xfrm: Cache used outbound xfrm states at the policy.") Reported-by: Dan Carpenter <[email protected]> Reviewed-by: Simon Horman <[email protected]> Signed-off-by: Steffen Klassert <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Manuel Diewald <[email protected]> Signed-off-by: Mehmet Basaran <[email protected]>
1 parent 610b26a commit c51bb2f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

net/xfrm/xfrm_state.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1510,6 +1510,7 @@ xfrm_state_find(const xfrm_address_t *daddr, const xfrm_address_t *saddr,
15101510
spin_lock_bh(&net->xfrm.xfrm_state_lock);
15111511
x->km.state = XFRM_STATE_ACQ;
15121512
list_add(&x->km.all, &net->xfrm.state_all);
1513+
h = xfrm_dst_hash(net, daddr, saddr, tmpl->reqid, encap_family);
15131514
XFRM_STATE_INSERT(bydst, &x->bydst,
15141515
net->xfrm.state_bydst + h,
15151516
x->xso.type);

0 commit comments

Comments
 (0)