summaryrefslogtreecommitdiff
path: root/include/net
diff options
context:
space:
mode:
authorKuniyuki Iwashima <kuniyu@google.com>2026-06-29 18:10:55 +0000
committerPaolo Abeni <pabeni@redhat.com>2026-07-01 18:42:33 +0200
commit4b8f5c974d14dc955b4252c02d5e4f185ddc9b23 (patch)
treed2a8979e1ad0459689fbfe1bff699301f0ea9217 /include/net
parent5cb890ff73573f2924877d9a6b4a298f021a9cc5 (diff)
downloadlinux-next-4b8f5c974d14dc955b4252c02d5e4f185ddc9b23.tar.gz
linux-next-4b8f5c974d14dc955b4252c02d5e4f185ddc9b23.zip
ipv4: fib: Protect fib_new_table() with spinlock.
fib_newrule() will drop RTNL except for the first IPv4 rule. Then, fib4_rule_configure() could call fib_empty_table() and create a new IPv4 fib_table without RTNL. Currently, net->ipv4.fib_table_hash[] is only protected by RTNL. As a prep, let's protect net->ipv4.fib_table_hash[] with a dedicated spinlock. Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com> Link: https://patch.msgid.link/20260629181226.1929658-4-kuniyu@google.com Reviewed-by: Ido Schimmel <idosch@nvidia.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/netns/ipv4.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/net/netns/ipv4.h b/include/net/netns/ipv4.h
index 6e27c56514df..59506320558a 100644
--- a/include/net/netns/ipv4.h
+++ b/include/net/netns/ipv4.h
@@ -127,6 +127,7 @@ struct netns_ipv4 {
atomic_t fib_num_tclassid_users;
#endif
struct hlist_head *fib_table_hash;
+ spinlock_t fib_table_hash_lock;
struct sock *fibnl;
struct hlist_head *fib_info_hash;
unsigned int fib_info_hash_bits;