mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] ixgbevf: fix xfrm_state reference leak in ixgbevf_ipsec_rx()
@ 2026-09-17 11:14 Wentao Liang
  2026-09-21 10:34 ` Simon Horman
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Wentao Liang @ 2026-09-17 11:14 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

ixgbevf_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: 0062e7cc955e0 ("ixgbevf: add VF IPsec offload code")
Cc: stable@vger.kernel.org
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
---
 drivers/net/ethernet/intel/ixgbevf/ipsec.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/ixgbevf/ipsec.c b/drivers/net/ethernet/intel/ixgbevf/ipsec.c
index 076fd0a24858..bf3fcab3bd57 100644
--- a/drivers/net/ethernet/intel/ixgbevf/ipsec.c
+++ b/drivers/net/ethernet/intel/ixgbevf/ipsec.c
@@ -596,8 +596,10 @@ void ixgbevf_ipsec_rx(struct ixgbevf_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	[flat|nested] 7+ messages in thread

* Re: [PATCH] ixgbevf: fix xfrm_state reference leak in ixgbevf_ipsec_rx()
  2026-09-17 11:14 [PATCH] ixgbevf: fix xfrm_state reference leak in ixgbevf_ipsec_rx() Wentao Liang
@ 2026-09-21 10:34 ` Simon Horman
  2026-10-06  8:12   ` Romanowski, Rafal
  2026-09-21 15:29 ` Loktionov, Aleksandr
  2026-09-30  0:47 ` Joe Damato
  2 siblings, 1 reply; 7+ messages in thread
From: Simon Horman @ 2026-09-21 10:34 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:14:18AM +0000, Wentao Liang wrote:
> ixgbevf_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: 0062e7cc955e0 ("ixgbevf: add VF IPsec offload code")
> 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] 7+ messages in thread

* RE: [PATCH] ixgbevf: fix xfrm_state reference leak in ixgbevf_ipsec_rx()
  2026-09-17 11:14 [PATCH] ixgbevf: fix xfrm_state reference leak in ixgbevf_ipsec_rx() Wentao Liang
  2026-09-21 10:34 ` Simon Horman
@ 2026-09-21 15:29 ` Loktionov, Aleksandr
  2026-10-06  8:06   ` Romanowski, Rafal
  2026-09-30  0:47 ` Joe Damato
  2 siblings, 1 reply; 7+ messages in thread
From: Loktionov, Aleksandr @ 2026-09-21 15:29 UTC (permalink / raw)
  To: Wentao Liang, andrew+netdev
  Cc: Nguyen, Anthony L, davem, edumazet, intel-wired-lan, kuba,
	linux-kernel, netdev, pabeni, Kitszel, Przemyslaw, sln, stable



> -----Original Message-----
> From: Wentao Liang <vulab@iscas.ac.cn>
> Sent: Thursday, September 17, 2026 1:14 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] ixgbevf: fix xfrm_state reference leak in
> ixgbevf_ipsec_rx()
> 
> ixgbevf_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: 0062e7cc955e0 ("ixgbevf: add VF IPsec offload code")
> Cc: stable@vger.kernel.org
> Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
> ---
>  drivers/net/ethernet/intel/ixgbevf/ipsec.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/intel/ixgbevf/ipsec.c
> b/drivers/net/ethernet/intel/ixgbevf/ipsec.c
> index 076fd0a24858..bf3fcab3bd57 100644
> --- a/drivers/net/ethernet/intel/ixgbevf/ipsec.c
> +++ b/drivers/net/ethernet/intel/ixgbevf/ipsec.c
> @@ -596,8 +596,10 @@ void ixgbevf_ipsec_rx(struct ixgbevf_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] 7+ messages in thread

* Re: [PATCH] ixgbevf: fix xfrm_state reference leak in ixgbevf_ipsec_rx()
  2026-09-17 11:14 [PATCH] ixgbevf: fix xfrm_state reference leak in ixgbevf_ipsec_rx() Wentao Liang
  2026-09-21 10:34 ` Simon Horman
  2026-09-21 15:29 ` Loktionov, Aleksandr
@ 2026-09-30  0:47 ` Joe Damato
  2026-10-06  8:02   ` Romanowski, Rafal
  2 siblings, 1 reply; 7+ messages in thread
From: Joe Damato @ 2026-09-30  0:47 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:14:18AM +0000, Wentao Liang wrote:
> ixgbevf_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: 0062e7cc955e0 ("ixgbevf: add VF IPsec offload code")
> Cc: stable@vger.kernel.org
> Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
> ---
>  drivers/net/ethernet/intel/ixgbevf/ipsec.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 

Reviewed-by: Joe Damato <joe@dama.to>

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

* RE: [PATCH] ixgbevf: fix xfrm_state reference leak in ixgbevf_ipsec_rx()
  2026-09-30  0:47 ` Joe Damato
@ 2026-10-06  8:02   ` Romanowski, Rafal
  0 siblings, 0 replies; 7+ messages in thread
From: Romanowski, Rafal @ 2026-10-06  8:02 UTC (permalink / raw)
  To: Joe Damato, Wentao Liang
  Cc: andrew+netdev, Nguyen, Anthony L, davem, edumazet,
	intel-wired-lan, kuba, linux-kernel, netdev, pabeni, Kitszel,
	Przemyslaw, sln, stable

> -----Original Message-----
> From: Joe Damato <joe@dama.to>
> Sent: Wednesday, September 30, 2026 2:48 AM
> To: Wentao Liang <vulab@iscas.ac.cn>
> Cc: andrew+netdev@lunn.ch; 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; stable@vger.kernel.org
> Subject: Re: [PATCH] ixgbevf: fix xfrm_state reference leak in ixgbevf_ipsec_rx()
> 
> On Thu, Sep 17, 2026 at 11:14:18AM +0000, Wentao Liang wrote:
> > ixgbevf_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: 0062e7cc955e0 ("ixgbevf: add VF IPsec offload code")
> > Cc: stable@vger.kernel.org
> > Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
> > ---
> >  drivers/net/ethernet/intel/ixgbevf/ipsec.c | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> >
> 
> Reviewed-by: Joe Damato <joe@dama.to>


Tested-by: Rafal Romanowski <rafal.romanowski@intel.com>


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

* RE: [PATCH] ixgbevf: fix xfrm_state reference leak in ixgbevf_ipsec_rx()
  2026-09-21 15:29 ` Loktionov, Aleksandr
@ 2026-10-06  8:06   ` Romanowski, Rafal
  0 siblings, 0 replies; 7+ messages in thread
From: Romanowski, Rafal @ 2026-10-06  8:06 UTC (permalink / raw)
  To: Loktionov, Aleksandr, Wentao Liang, andrew+netdev
  Cc: Nguyen, Anthony L, davem, edumazet, intel-wired-lan, kuba,
	linux-kernel, netdev, pabeni, Kitszel, Przemyslaw, sln, stable

> -----Original Message-----
> From: Loktionov, Aleksandr <aleksandr.loktionov@intel.com>
> Sent: Monday, September 21, 2026 5:30 PM
> To: Wentao Liang <vulab@iscas.ac.cn>; 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;
> stable@vger.kernel.org
> Subject: RE: [PATCH] ixgbevf: fix xfrm_state reference leak in ixgbevf_ipsec_rx()
> 
> 
> 
> > -----Original Message-----
> > From: Wentao Liang <vulab@iscas.ac.cn>
> > Sent: Thursday, September 17, 2026 1:14 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] ixgbevf: fix xfrm_state reference leak in
> > ixgbevf_ipsec_rx()
> >
> > ixgbevf_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: 0062e7cc955e0 ("ixgbevf: add VF IPsec offload code")
> > Cc: stable@vger.kernel.org
> > Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
> > ---
> >  drivers/net/ethernet/intel/ixgbevf/ipsec.c | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/ethernet/intel/ixgbevf/ipsec.c
> > b/drivers/net/ethernet/intel/ixgbevf/ipsec.c
> > index 076fd0a24858..bf3fcab3bd57 100644
> > --- a/drivers/net/ethernet/intel/ixgbevf/ipsec.c
> > +++ b/drivers/net/ethernet/intel/ixgbevf/ipsec.c
> > @@ -596,8 +596,10 @@ void ixgbevf_ipsec_rx(struct ixgbevf_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>


Tested-by: Rafal Romanowski <rafal.romanowski@intel.com>


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

* RE: [PATCH] ixgbevf: fix xfrm_state reference leak in ixgbevf_ipsec_rx()
  2026-09-21 10:34 ` Simon Horman
@ 2026-10-06  8:12   ` Romanowski, Rafal
  0 siblings, 0 replies; 7+ messages in thread
From: Romanowski, Rafal @ 2026-10-06  8:12 UTC (permalink / raw)
  To: Simon Horman, Wentao Liang
  Cc: andrew+netdev, Nguyen, Anthony L, davem, edumazet,
	intel-wired-lan, kuba, linux-kernel, netdev, pabeni, Kitszel,
	Przemyslaw, sln, stable

> -----Original Message-----
> From: Simon Horman <horms@kernel.org>
> Sent: Monday, September 21, 2026 12:35 PM
> To: Wentao Liang <vulab@iscas.ac.cn>
> Cc: andrew+netdev@lunn.ch; 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; stable@vger.kernel.org
> Subject: Re: [PATCH] ixgbevf: fix xfrm_state reference leak in ixgbevf_ipsec_rx()
> 
> On Thu, Sep 17, 2026 at 11:14:18AM +0000, Wentao Liang wrote:
> > ixgbevf_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: 0062e7cc955e0 ("ixgbevf: add VF IPsec offload code")
> > Cc: stable@vger.kernel.org
> > Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
> 
> Reviewed-by: Simon Horman <horms@kernel.org>

Tested-by: Rafal Romanowski <rafal.romanowski@intel.com>


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

end of thread, other threads:[~2026-10-06  8:14 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-17 11:14 [PATCH] ixgbevf: fix xfrm_state reference leak in ixgbevf_ipsec_rx() Wentao Liang
2026-09-21 10:34 ` Simon Horman
2026-10-06  8:12   ` Romanowski, Rafal
2026-09-21 15:29 ` Loktionov, Aleksandr
2026-10-06  8:06   ` Romanowski, Rafal
2026-09-30  0:47 ` Joe Damato
2026-10-06  8:02   ` Romanowski, Rafal

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

all inboxes | Powered by JetHome®