lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aSnKbzhftKx9f2yW@krikkit>
Date: Fri, 28 Nov 2025 17:14:39 +0100
From: Sabrina Dubroca <sd@...asysnail.net>
To: Jianbo Liu <jianbol@...dia.com>
Cc: netdev@...r.kernel.org, davem@...emloft.net, kuba@...nel.org,
	steffen.klassert@...unet.com, Cosmin Ratiu <cratiu@...dia.com>,
	Herbert Xu <herbert@...dor.apana.org.au>,
	David Ahern <dsahern@...nel.org>,
	Eric Dumazet <edumazet@...gle.com>, Paolo Abeni <pabeni@...hat.com>,
	Simon Horman <horms@...nel.org>
Subject: Re: [PATCH ipsec-next v3] xfrm: Use xfrm_ip2inner_mode()
 unconditionally

2025-11-28, 05:48:04 +0200, Jianbo Liu wrote:
> Commit c9500d7b7de8 ("xfrm: store xfrm_mode directly, not its
> address") changed how the xfrm_mode is stored in the xfrm state. The
> inner_mode NULL check is redundant as xfrm_ip2inner_mode() now returns
> the address of an embedded structure, which cannot be NULL.
> 
> Additionally, commit 61fafbee6cfe ("xfrm: Determine inner GSO type
> from packet inner protocol") updated xfrm_ip2inner_mode() to
> explicitly check x->sel.family. If the selector family is specified
> (i.e., not AF_UNSPEC), the helper now correctly returns &x->inner_mode
> directly.

Note: that commit is not in ipsec-next yet, only in ipsec. This patch
should only be applied to ipsec-next once the trees have been merged
together.

> This means the manual branching which checked for AF_UNSPEC before
> deciding whether to call the helper or use the state's inner mode
> directly is no longer necessary.
> 
> This patch simplifies the code by calling xfrm_ip2inner_mode()
> unconditionally and removing the NULL checking.
> 
> Signed-off-by: Jianbo Liu <jianbol@...dia.com>
> Reviewed-by: Cosmin Ratiu <cratiu@...dia.com>
> ---
> V3:
>  - Change the commit subject (was "xfrm: Remove redundant state inner mode check").
>  - Call xfrm_ip2inner_mode() unconditionally and update the commit message accordingly.

Other than the tree scheduling comment above, the patch looks ok,
thanks.

Reviewed-by: Sabrina Dubroca <sd@...asysnail.net>

-- 
Sabrina

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ