]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
gtp: Use for_each_netdev_rcu() in gtp_genl_dump_pdp().
authorKuniyuki Iwashima <kuniyu@amazon.com>
Fri, 10 Jan 2025 01:47:52 +0000 (10:47 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 23 Jan 2025 16:15:58 +0000 (17:15 +0100)
commited8be92df48d9c4d72700287fbaa95226a49d092
treeecce9aedbf73289c78d3b696dfa73aa1042a4279
parenta111a7487f65e4976774bf340b2e381e07eef3c3
gtp: Use for_each_netdev_rcu() in gtp_genl_dump_pdp().

[ Upstream commit 46841c7053e6d25fb33e0534ef023833bf03e382 ]

gtp_newlink() links the gtp device to a list in dev_net(dev).

However, even after the gtp device is moved to another netns,
it stays on the list but should be invisible.

Let's use for_each_netdev_rcu() for netdev traversal in
gtp_genl_dump_pdp().

Note that gtp_dev_list is no longer used under RCU, so list
helpers are converted to the non-RCU variant.

Fixes: 459aa660eb1d ("gtp: add initial driver for datapath of GPRS Tunneling Protocol (GTP-U)")
Reported-by: Xiao Liang <shaw.leon@gmail.com>
Closes: https://lore.kernel.org/netdev/CABAhCOQdBL6h9M2C+kd+bGivRJ9Q72JUxW+-gur0nub_=PmFPA@mail.gmail.com/
Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/gtp.c