[PATCH] xfrm: fix gro_cells leak when remove virtual xfrm interfaces

Subsystems: networking [general], networking [ipsec], the rest

STALE2909d

2 messages, 2 authors, 2018-10-03 · open the first message on its own page

[PATCH] xfrm: fix gro_cells leak when remove virtual xfrm interfaces

From: Li RongQing <hidden>
Date: 2018-09-30 13:38:17

The device gro_cells has been initialized, it should be freed,
otherwise it will be leaked

Fixes: f203b76d78092faf2 ("xfrm: Add virtual xfrm interfaces")
Signed-off-by: Zhang Yu <redacted>
Signed-off-by: Li RongQing <redacted>
---
 net/xfrm/xfrm_interface.c | 3 +++
 1 file changed, 3 insertions(+)
diff --git a/net/xfrm/xfrm_interface.c b/net/xfrm/xfrm_interface.c
index 4b4ef4f662d9..9cc6e72bc802 100644
--- a/net/xfrm/xfrm_interface.c
+++ b/net/xfrm/xfrm_interface.c
@@ -116,6 +116,9 @@ static void xfrmi_unlink(struct xfrmi_net *xfrmn, struct xfrm_if *xi)
 
 static void xfrmi_dev_free(struct net_device *dev)
 {
+	struct xfrm_if *xi = netdev_priv(dev);
+
+	gro_cells_destroy(&xi->gro_cells);
 	free_percpu(dev->tstats);
 }
 
-- 
2.16.2

Re: [PATCH] xfrm: fix gro_cells leak when remove virtual xfrm interfaces

From: Steffen Klassert <steffen.klassert@secunet.com>
Date: 2018-10-03 14:15:00

On Sun, Sep 30, 2018 at 03:06:06PM +0800, Li RongQing wrote:
The device gro_cells has been initialized, it should be freed,
otherwise it will be leaked

Fixes: f203b76d78092faf2 ("xfrm: Add virtual xfrm interfaces")
Signed-off-by: Zhang Yu <redacted>
Signed-off-by: Li RongQing <redacted>
Applied, thanks a lot!
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help