diff mbox series

[ipsec-next] xfrm: Fix acquire state insertion.

Message ID ZzXZ0BaL9ypZ1ilY@gauss3.secunet.de (mailing list archive)
State Awaiting Upstream
Delegated to: Netdev Maintainers
Headers show
Series [ipsec-next] xfrm: Fix acquire state insertion. | expand

Checks

Context Check Description
netdev/series_format warning Single patches do not need cover letters; Target tree name not specified in the subject
netdev/tree_selection success Guessed tree name to be net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 3 this patch: 3
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers warning 5 maintainers not CCed: kuba@kernel.org horms@kernel.org pabeni@redhat.com edumazet@google.com herbert@gondor.apana.org.au
netdev/build_clang success Errors and warnings before: 3 this patch: 3
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes fail Problems with Fixes tag: 1
netdev/build_allmodconfig_warn success Errors and warnings before: 105 this patch: 105
netdev/checkpatch warning WARNING: Unknown commit id '0045e3d80613', maybe rebased or not pulled? WARNING: line length of 88 exceeds 80 columns
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest fail net-next-2024-11-14--12-00 (tests: 783)

Commit Message

Steffen Klassert Nov. 14, 2024, 11:06 a.m. UTC
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>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
---
 net/xfrm/xfrm_state.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Simon Horman Nov. 14, 2024, 6:11 p.m. UTC | #1
On Thu, Nov 14, 2024 at 12:06:56PM +0100, Steffen Klassert wrote:
> 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>
> Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>

Reviewed-by: Simon Horman <horms@kernel.org>
Steffen Klassert Nov. 15, 2024, 8:09 a.m. UTC | #2
On Thu, Nov 14, 2024 at 06:11:38PM +0000, Simon Horman wrote:
> On Thu, Nov 14, 2024 at 12:06:56PM +0100, Steffen Klassert wrote:
> > 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>
> > Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
> 
> Reviewed-by: Simon Horman <horms@kernel.org>

This is now applied to ipsec-next. Thanks for the review Simon!
diff mbox series

Patch

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 @@  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);