netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xfrm: xfrm_input: fix a possible memory leak in xfrm_input()
@ 2022-05-30 10:20 Hangyu Hua
  2022-05-30 10:37 ` Steffen Klassert
  0 siblings, 1 reply; 5+ messages in thread
From: Hangyu Hua @ 2022-05-30 10:20 UTC (permalink / raw)
  To: steffen.klassert, herbert, davem, edumazet, kuba, pabeni
  Cc: netdev, linux-kernel, Hangyu Hua

xfrm_input needs to handle skb internally. But skb is not freed When
xo->flags & XFRM_GRO == 0 and decaps == 0.

Fixes: 7785bba299a8 ("esp: Add a software GRO codepath")
Signed-off-by: Hangyu Hua <hbh25y@gmail.com>
---
 net/xfrm/xfrm_input.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/xfrm/xfrm_input.c b/net/xfrm/xfrm_input.c
index 144238a50f3d..6f9576352f30 100644
--- a/net/xfrm/xfrm_input.c
+++ b/net/xfrm/xfrm_input.c
@@ -742,7 +742,7 @@ int xfrm_input(struct sk_buff *skb, int nexthdr, __be32 spi, int encap_type)
 			gro_cells_receive(&gro_cells, skb);
 			return err;
 		}
-
+		kfree_skb(skb);
 		return err;
 	}
 
-- 
2.25.1


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

end of thread, other threads:[~2022-06-01  2:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-30 10:20 [PATCH] xfrm: xfrm_input: fix a possible memory leak in xfrm_input() Hangyu Hua
2022-05-30 10:37 ` Steffen Klassert
2022-05-31  2:12   ` Hangyu Hua
2022-05-31 11:35     ` Steffen Klassert
2022-06-01  2:47       ` Hangyu Hua

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).