]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ipv4: fib: Hold rtnl_net_lock() in ip_rt_ioctl().
authorKuniyuki Iwashima <kuniyu@amazon.com>
Fri, 28 Feb 2025 04:23:26 +0000 (20:23 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 29 May 2025 09:13:00 +0000 (11:13 +0200)
commit35a2da131318bd7466eb32b83bed87e1c8abed91
tree963652745d34532435400fdff9027617cae49c41
parent84967406ec18e7b22ba72317144a771255d9c65e
ipv4: fib: Hold rtnl_net_lock() in ip_rt_ioctl().

[ Upstream commit c0ebe1cdc2cff0dee092a67f2c50377bb5fcf43d ]

ioctl(SIOCADDRT/SIOCDELRT) calls ip_rt_ioctl() to add/remove a route in
the netns of the specified socket.

Let's hold rtnl_net_lock() there.

Note that rtentry_to_fib_config() can be called without rtnl_net_lock()
if we convert rtentry.dev handling to RCU later.

Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Link: https://patch.msgid.link/20250228042328.96624-11-kuniyu@amazon.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/ipv4/fib_frontend.c