Skip to content

Commit 807cac8

Browse files
Alexander Duyckgregkh
authored andcommitted
ipv4: Do not allow MAIN to be alias for new LOCAL w/ custom rules
[ Upstream commit 5350d54f6cd12eaff623e890744c79b700bd3f17 ] In the case of custom rules being present we need to handle the case of the LOCAL table being intialized after the new rule has been added. To address that I am adding a new check so that we can make certain we don't use an alias of MAIN for LOCAL when allocating a new table. Fixes: 0ddcf43 ("ipv4: FIB Local/MAIN table collapse") Reported-by: Oliver Brunel <jjk@jjacky.com> Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 0d431f9 commit 807cac8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

net/ipv4/fib_frontend.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ struct fib_table *fib_new_table(struct net *net, u32 id)
8585
if (tb)
8686
return tb;
8787

88-
if (id == RT_TABLE_LOCAL)
88+
if (id == RT_TABLE_LOCAL && !net->ipv4.fib_has_custom_rules)
8989
alias = fib_new_table(net, RT_TABLE_MAIN);
9090

9191
tb = fib_trie_table(id, alias);

0 commit comments

Comments
 (0)