]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
ipv6: fix WARNING in ip6_route_net_exit_late()
authorZhengchao Shao <shaozhengchao@huawei.com>
Wed, 2 Nov 2022 02:06:10 +0000 (10:06 +0800)
committerStefan Bader <stefan.bader@canonical.com>
Tue, 6 Dec 2022 13:45:35 +0000 (14:45 +0100)
commit45240b39c8fa99389a311270c3be7d9f87c1f25d
treef6bfc57cae7785c3891b23990825f3dccef1d5c2
parent141c3444c324772ca049b1e2b7d810b125c0374b
ipv6: fix WARNING in ip6_route_net_exit_late()

BugLink: https://bugs.launchpad.net/bugs/1998843
[ 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@huawei.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Link: https://lore.kernel.org/r/20221102020610.351330-1-shaozhengchao@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
net/ipv6/route.c