ipv4: Do not allow MAIN to be alias for new LOCAL w/ custom rules
Subsystems (3)
PATCH 1/1 ipv4: Do not allow MAIN to be alias for new LOCAL w/ custom rules
From: Alexander Duyck <[email protected]>
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.
--- net/ipv4/fib_frontend.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv4/fib_frontend.c +1 -1
@@ -85,7 +85,7 @@ struct fib_table *fib_new_table(struct net *net, u32 id)if (tb)return tb; -if (id ==RT_TABLE_LOCAL ) +if (id ==RT_TABLE_LOCAL && !net->ipv4.fib_has_custom_rules) alias =fib_new_table (net,RT_TABLE_MAIN ); tb =fib_trie_table (id, alias);
David Miller
maintainerFrom: Alexander Duyck <[email protected]>
Date: Mon, 02 Jan 2017 13:32:54 -0800
Quoted 10 lines
From: Alexander Duyck <[email protected]>
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 0ddcf43d5d4a ("ipv4: FIB Local/MAIN table collapse")Reported-by Oliver Brunel <[email protected]>Signed-off-by Alexander Duyck <[email protected]>
Applied and queued up for -stable, thanks Alex.