Patch "ipv6: fix WARNING in ip6_route_net_exit_late()" 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

    ipv6: fix WARNING in ip6_route_net_exit_late()

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:
     ipv6-fix-warning-in-ip6_route_net_exit_late.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 b93b16e1ca17cdd9a1423b2e54570e38ffae3a02
Author: Zhengchao Shao <shaozhengchao@xxxxxxxxxx>
Date:   Wed Nov 2 10:06:10 2022 +0800

    ipv6: fix WARNING in ip6_route_net_exit_late()
    
    [ Upstream commit 768b3c745fe5789f2430bdab02f35a9ad1148d97 ]
    
    During the initialization of ip6_route_net_init_late(), if file
    ipv6_route or rt6_stats fails to be created, the initialization is
    successful by default. Therefore, the ipv6_route or rt6_stats file
    doesn't be found during the remove in ip6_route_net_exit_late(). It
    will cause WRNING.
    
    The following is the stack information:
    name 'rt6_stats'
    WARNING: CPU: 0 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
    PKRU: 55555554
    Call Trace:
    <TASK>
    ops_exit_list+0xb0/0x170
    cleanup_net+0x4ea/0xb00
    process_one_work+0x9bf/0x1710
    worker_thread+0x665/0x1080
    kthread+0x2e4/0x3a0
    ret_from_fork+0x1f/0x30
    </TASK>
    
    Fixes: cdb1876192db ("[NETNS][IPV6] route6 - create route6 proc files for the namespace")
    Signed-off-by: Zhengchao Shao <shaozhengchao@xxxxxxxxxx>
    Reviewed-by: Eric Dumazet <edumazet@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20221102020610.351330-1-shaozhengchao@xxxxxxxxxx
    Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index b940285a111e..7b41d5d3575f 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -5374,10 +5374,16 @@ static void __net_exit ip6_route_net_exit(struct net *net)
 static int __net_init ip6_route_net_init_late(struct net *net)
 {
 #ifdef CONFIG_PROC_FS
-	proc_create_net("ipv6_route", 0, net->proc_net, &ipv6_route_seq_ops,
-			sizeof(struct ipv6_route_iter));
-	proc_create_net_single("rt6_stats", 0444, net->proc_net,
-			rt6_stats_seq_show, NULL);
+	if (!proc_create_net("ipv6_route", 0, net->proc_net,
+			     &ipv6_route_seq_ops,
+			     sizeof(struct ipv6_route_iter)))
+		return -ENOMEM;
+
+	if (!proc_create_net_single("rt6_stats", 0444, net->proc_net,
+				    rt6_stats_seq_show, NULL)) {
+		remove_proc_entry("ipv6_route", net->proc_net);
+		return -ENOMEM;
+	}
 #endif
 	return 0;
 }



[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