]> Git Repo - J-linux.git/commitdiff
xfrm: Fix acquire state insertion.
authorSteffen Klassert <[email protected]>
Thu, 14 Nov 2024 11:06:56 +0000 (12:06 +0100)
committerSteffen Klassert <[email protected]>
Fri, 15 Nov 2024 06:25:14 +0000 (07:25 +0100)
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]>
Reviewed-by: Simon Horman <[email protected]>
Signed-off-by: Steffen Klassert <[email protected]>
net/xfrm/xfrm_state.c

index e3266a5d4f90d8cebf0a6df7788944200b04ea6b..67ca7ac955a376197c487c4a851cc719324b05f8 100644 (file)
@@ -1470,6 +1470,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);
This page took 0.043029 seconds and 4 git commands to generate.