Patch "ipvs: fix WARNING in ip_vs_app_net_cleanup()" has been added to the 4.19-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    ipvs: fix WARNING in ip_vs_app_net_cleanup()

to the 4.19-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     ipvs-fix-warning-in-ip_vs_app_net_cleanup.patch
and it can be found in the queue-4.19 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 847f96f64cea632377c895a9332a34e149a9013c
Author: Zhengchao Shao <shaozhengchao@xxxxxxxxxx>
Date:   Mon Oct 31 20:07:05 2022 +0800

    ipvs: fix WARNING in ip_vs_app_net_cleanup()
    
    [ Upstream commit 5663ed63adb9619c98ab7479aa4606fa9b7a548c ]
    
    During the initialization of ip_vs_app_net_init(), if file ip_vs_app
    fails to be created, the initialization is successful by default.
    Therefore, the ip_vs_app file doesn't be found during the remove in
    ip_vs_app_net_cleanup(). It will cause WRNING.
    
    The following is the stack information:
    name 'ip_vs_app'
    WARNING: CPU: 1 PID: 9 at fs/proc/generic.c:712 remove_proc_entry+0x389/0x460
    Modules linked in:
    Workqueue: netns cleanup_net
    RIP: 0010:remove_proc_entry+0x389/0x460
    Call Trace:
    <TASK>
    ops_exit_list+0x125/0x170
    cleanup_net+0x4ea/0xb00
    process_one_work+0x9bf/0x1710
    worker_thread+0x665/0x1080
    kthread+0x2e4/0x3a0
    ret_from_fork+0x1f/0x30
    </TASK>
    
    Fixes: 457c4cbc5a3d ("[NET]: Make /proc/net per network namespace")
    Signed-off-by: Zhengchao Shao <shaozhengchao@xxxxxxxxxx>
    Acked-by: Julian Anastasov <ja@xxxxxx>
    Signed-off-by: Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/net/netfilter/ipvs/ip_vs_app.c b/net/netfilter/ipvs/ip_vs_app.c
index 80759aadd3e0..21149f4e0b6e 100644
--- a/net/netfilter/ipvs/ip_vs_app.c
+++ b/net/netfilter/ipvs/ip_vs_app.c
@@ -604,13 +604,19 @@ static const struct seq_operations ip_vs_app_seq_ops = {
 int __net_init ip_vs_app_net_init(struct netns_ipvs *ipvs)
 {
 	INIT_LIST_HEAD(&ipvs->app_list);
-	proc_create_net("ip_vs_app", 0, ipvs->net->proc_net, &ip_vs_app_seq_ops,
-			sizeof(struct seq_net_private));
+#ifdef CONFIG_PROC_FS
+	if (!proc_create_net("ip_vs_app", 0, ipvs->net->proc_net,
+			     &ip_vs_app_seq_ops,
+			     sizeof(struct seq_net_private)))
+		return -ENOMEM;
+#endif
 	return 0;
 }
 
 void __net_exit ip_vs_app_net_cleanup(struct netns_ipvs *ipvs)
 {
 	unregister_ip_vs_app(ipvs, NULL /* all */);
+#ifdef CONFIG_PROC_FS
 	remove_proc_entry("ip_vs_app", ipvs->net->proc_net);
+#endif
 }



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux