summaryrefslogtreecommitdiffstats
path: root/net/xfrm
diff options
context:
space:
mode:
authorSteffen Klassert <steffen.klassert@secunet.com>2024-11-14 12:06:56 +0100
committerSteffen Klassert <steffen.klassert@secunet.com>2024-11-15 07:25:14 +0100
commita35672819f8d85e2ae38b80d40b923e3ef81e4ea (patch)
tree9e68c50d6a72e158e5f7d7e7190a44db73831416 /net/xfrm
parent9e1a6db68e3ccc5c20fd2d6243285d1cc7215fe4 (diff)
downloadlinux-stable-a35672819f8d85e2ae38b80d40b923e3ef81e4ea.tar.gz
linux-stable-a35672819f8d85e2ae38b80d40b923e3ef81e4ea.tar.bz2
linux-stable-a35672819f8d85e2ae38b80d40b923e3ef81e4ea.zip
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 <dan.carpenter@linaro.org> Reviewed-by: Simon Horman <horms@kernel.org> Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Diffstat (limited to 'net/xfrm')
-rw-r--r--net/xfrm/xfrm_state.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
index e3266a5d4f90..67ca7ac955a3 100644
--- a/net/xfrm/xfrm_state.c
+++ b/net/xfrm/xfrm_state.c
@@ -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);