Commit e044a651 authored by David S. Miller's avatar David S. Miller
Browse files

ipv4: Fix crashes in fib_rules_tclass().

All paths assume, when CONFIG_IP_MULTIPLE_TABLES is enabled, that any
successful call to fib_lookup() will initialize the fib_result->r
value to something.

We violated that expectation in the new fib_lookup() fast path.

Reported-by: default avatarOr Gerlitz <>
Tested-by: default avatarEric Dumazet <>
Tested-by: default avatarGreg Rose <>
Signed-off-by: default avatarDavid S. Miller <>
parent 061a5c31
......@@ -230,6 +230,7 @@ static inline int fib_lookup(struct net *net, struct flowi4 *flp,
struct fib_result *res)
if (!net->ipv4.fib_has_custom_rules) {
res->r = NULL;
if (net->ipv4.fib_local &&
!fib_table_lookup(net->ipv4.fib_local, flp, res,
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment