[Devel] [PATCH RHEL7 COMMIT] ms/xfrm6_tunnel: exit_net cleanup check added

Vasily Averin vvs at virtuozzo.com
Tue Jun 15 16:05:40 MSK 2021


The commit is pushed to "branch-rh7-3.10.0-1160.31.1.vz7.181.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-1160.31.1.vz7.181.3
------>
commit 2603f246dcd7cc3a03cc46867595b56dd72e35de
Author: Vasily Averin <vvs at virtuozzo.com>
Date:   Tue Jun 15 16:05:40 2021 +0300

    ms/xfrm6_tunnel: exit_net cleanup check added
    
    Be sure that spi_byaddr and spi_byspi arrays initialized in net_init hook
    were return to initial state
    
    Signed-off-by: Vasily Averin <vvs at virtuozzo.com>
    
    Signed-off-by: David S. Miller <davem at davemloft.net>
    (cherry picked from ms commit baeb0dbbb56598a2ccd98b56e0da3e9d22869112)
    https://jira.sw.ru/browse/PSBM-130602
    Signed-off-by: Vasily Averin <vvs at virtuozzo.com>
---
 net/ipv6/xfrm6_tunnel.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/net/ipv6/xfrm6_tunnel.c b/net/ipv6/xfrm6_tunnel.c
index 6a710f4..39ab663 100644
--- a/net/ipv6/xfrm6_tunnel.c
+++ b/net/ipv6/xfrm6_tunnel.c
@@ -341,6 +341,14 @@ static int __net_init xfrm6_tunnel_net_init(struct net *net)
 
 static void __net_exit xfrm6_tunnel_net_exit(struct net *net)
 {
+	struct xfrm6_tunnel_net *xfrm6_tn = xfrm6_tunnel_pernet(net);
+	unsigned int i;
+
+	for (i = 0; i < XFRM6_TUNNEL_SPI_BYADDR_HSIZE; i++)
+		WARN_ON_ONCE(!hlist_empty(&xfrm6_tn->spi_byaddr[i]));
+
+	for (i = 0; i < XFRM6_TUNNEL_SPI_BYSPI_HSIZE; i++)
+		WARN_ON_ONCE(!hlist_empty(&xfrm6_tn->spi_byspi[i]));
 }
 
 static struct pernet_operations xfrm6_tunnel_net_ops = {


More information about the Devel mailing list