[Devel] [PATCH RHEL7 COMMIT] ms/netns: restore ops before calling ops_exit_list

Konstantin Khorenko khorenko at virtuozzo.com
Mon Sep 30 15:24:17 MSK 2024


The commit is pushed to "branch-rh7-3.10.0-1160.119.1.vz7.224.x-ovz" and will appear at git at bitbucket.org:openvz/vzkernel.git
after rh7-3.10.0-1160.119.1.vz7.224.3
------>
commit 77e920920a553167dea0ef54fc7034d355b2cee4
Author: Li RongQing <lirongqing at baidu.com>
Date:   Thu Jun 20 19:24:40 2019 +0800

    ms/netns: restore ops before calling ops_exit_list
    
    ops has been iterated to first element when call pre_exit, and
    it needs to restore from save_ops, not save ops to save_ops
    
    mFixes: d7d99872c144 ("netns: add pre_exit method to struct pernet_operations")
    Signed-off-by: Li RongQing <lirongqing at baidu.com>
    Reviewed-by: Eric Dumazet <edumazet at google.com>
    Signed-off-by: David S. Miller <davem at davemloft.net>
    
    https://virtuozzo.atlassian.net/browse/PSBM-155867
    (cherry picked from commit b272a0ad730103e84fb735fd0a8cc050cdf7f77c)
    Signed-off-by: Konstantin Khorenko <khorenko at virtuozzo.com>
    
    =================
    Patchset description:
    netfilter: ipset: Fix possible cause of memory corruption
---
 net/core/net_namespace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c
index 16d3a111d882..cecc0ffefd3b 100644
--- a/net/core/net_namespace.c
+++ b/net/core/net_namespace.c
@@ -355,7 +355,7 @@ static __net_init int setup_net(struct net *net, struct user_namespace *user_ns)
 
 	synchronize_rcu();
 
-	saved_ops = ops;
+	ops = saved_ops;
 	list_for_each_entry_continue_reverse(ops, &pernet_list, list)
 		ops_exit_list(ops, &net_exit_list);
 


More information about the Devel mailing list