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
  2026-09-21 15:29 ` Loktionov, Aleksandr
  0 siblings, 2 replies; 3+ 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] 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: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

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®