Netdev List
 help / color / mirror / Atom feed
* [PATCH] ixgbe: fix xfrm_state reference leak in ixgbe_ipsec_rx()
@ 2026-09-17 11:13 Wentao Liang
  2026-09-21 10:33 ` Simon Horman
  2026-09-21 15:29 ` Loktionov, Aleksandr
  0 siblings, 2 replies; 3+ messages in thread
From: Wentao Liang @ 2026-09-17 11:13 UTC (permalink / raw)
  To: andrew+netdev
  Cc: anthony.l.nguyen, davem, edumazet, intel-wired-lan, kuba,
	linux-kernel, netdev, pabeni, przemyslaw.kitszel, sln,
	Wentao Liang, stable

ixgbe_ipsec_find_rx_state() returns the state with an extra reference,
which is handed over to the secpath on the success path. When
secpath_set() fails, the state has not been stored anywhere yet and the
reference is dropped on the floor.

Release it before returning.

Fixes: 92103199f10a3 ("ixgbe: process the Rx ipsec offload")
Cc: stable@vger.kernel.org
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
---
 drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c
index bd397b3d7dea..e44d5eed9ab5 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c
@@ -1197,8 +1197,10 @@ void ixgbe_ipsec_rx(struct ixgbe_ring *rx_ring,
 		return;
 
 	sp = secpath_set(skb);
-	if (unlikely(!sp))
+	if (unlikely(!sp)) {
+		xfrm_state_put(xs);
 		return;
+	}
 
 	sp->xvec[sp->len++] = xs;
 	sp->olen++;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ixgbe: fix xfrm_state reference leak in ixgbe_ipsec_rx()
  2026-09-17 11:13 [PATCH] ixgbe: fix xfrm_state reference leak in ixgbe_ipsec_rx() Wentao Liang
@ 2026-09-21 10:33 ` Simon Horman
  2026-09-21 15:29 ` Loktionov, Aleksandr
  1 sibling, 0 replies; 3+ messages in thread
From: Simon Horman @ 2026-09-21 10:33 UTC (permalink / raw)
  To: Wentao Liang
  Cc: andrew+netdev, anthony.l.nguyen, davem, edumazet, intel-wired-lan,
	kuba, linux-kernel, netdev, pabeni, przemyslaw.kitszel, sln,
	stable

On Thu, Sep 17, 2026 at 11:13:17AM +0000, Wentao Liang wrote:
> ixgbe_ipsec_find_rx_state() returns the state with an extra reference,
> which is handed over to the secpath on the success path. When
> secpath_set() fails, the state has not been stored anywhere yet and the
> reference is dropped on the floor.
> 
> Release it before returning.
> 
> Fixes: 92103199f10a3 ("ixgbe: process the Rx ipsec offload")
> Cc: stable@vger.kernel.org
> Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>

Reviewed-by: Simon Horman <horms@kernel.org>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [PATCH] ixgbe: fix xfrm_state reference leak in ixgbe_ipsec_rx()
  2026-09-17 11:13 [PATCH] ixgbe: fix xfrm_state reference leak in ixgbe_ipsec_rx() Wentao Liang
  2026-09-21 10:33 ` Simon Horman
@ 2026-09-21 15:29 ` Loktionov, Aleksandr
  1 sibling, 0 replies; 3+ messages in thread
From: Loktionov, Aleksandr @ 2026-09-21 15:29 UTC (permalink / raw)
  To: Wentao Liang, andrew+netdev@lunn.ch
  Cc: Nguyen, Anthony L, davem@davemloft.net, edumazet@google.com,
	intel-wired-lan@lists.osuosl.org, kuba@kernel.org,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	pabeni@redhat.com, Kitszel, Przemyslaw, sln@onemain.com,
	stable@vger.kernel.org



> -----Original Message-----
> From: Wentao Liang <vulab@iscas.ac.cn>
> Sent: Thursday, September 17, 2026 1:13 PM
> To: andrew+netdev@lunn.ch
> Cc: Nguyen, Anthony L <anthony.l.nguyen@intel.com>;
> davem@davemloft.net; edumazet@google.com; intel-wired-
> lan@lists.osuosl.org; kuba@kernel.org; linux-kernel@vger.kernel.org;
> netdev@vger.kernel.org; pabeni@redhat.com; Kitszel, Przemyslaw
> <przemyslaw.kitszel@intel.com>; sln@onemain.com; Wentao Liang
> <vulab@iscas.ac.cn>; stable@vger.kernel.org
> Subject: [PATCH] ixgbe: fix xfrm_state reference leak in
> ixgbe_ipsec_rx()
> 
> ixgbe_ipsec_find_rx_state() returns the state with an extra reference,
> which is handed over to the secpath on the success path. When
> secpath_set() fails, the state has not been stored anywhere yet and
> the reference is dropped on the floor.
> 
> Release it before returning.
> 
> Fixes: 92103199f10a3 ("ixgbe: process the Rx ipsec offload")
> Cc: stable@vger.kernel.org
> Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
> ---
>  drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c
> b/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c
> index bd397b3d7dea..e44d5eed9ab5 100644
> --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c
> +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c
> @@ -1197,8 +1197,10 @@ void ixgbe_ipsec_rx(struct ixgbe_ring *rx_ring,
>  		return;
> 
>  	sp = secpath_set(skb);
> -	if (unlikely(!sp))
> +	if (unlikely(!sp)) {
> +		xfrm_state_put(xs);
>  		return;
> +	}
> 
>  	sp->xvec[sp->len++] = xs;
>  	sp->olen++;
> --
> 2.34.1

Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-09-21 15:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-17 11:13 [PATCH] ixgbe: fix xfrm_state reference leak in ixgbe_ipsec_rx() Wentao Liang
2026-09-21 10:33 ` Simon Horman
2026-09-21 15:29 ` Loktionov, Aleksandr

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox