diff options
author | David S. Miller <davem@davemloft.net> | 2012-07-10 21:05:28 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-07-10 21:05:28 -0400 |
commit | e044a651b9b7b1b33d8b7fdb2bb27e443f392083 (patch) | |
tree | 96901e4acad88432a7359bc5fc74c14782f6065b /include/net/ip_fib.h | |
parent | 061a5c316b6526dbc729049a16243ec27937cc31 (diff) |
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: Or Gerlitz <ogerlitz@mellanox.com>
Tested-by: Eric Dumazet <eric.dumazet@gmail.com>
Tested-by: Greg Rose <gregory.v.rose@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/ip_fib.h')
-rw-r--r-- | include/net/ip_fib.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h index 539c6721f810..000c4674e18e 100644 --- a/include/net/ip_fib.h +++ b/include/net/ip_fib.h | |||
@@ -230,6 +230,7 @@ static inline int fib_lookup(struct net *net, struct flowi4 *flp, | |||
230 | struct fib_result *res) | 230 | struct fib_result *res) |
231 | { | 231 | { |
232 | if (!net->ipv4.fib_has_custom_rules) { | 232 | if (!net->ipv4.fib_has_custom_rules) { |
233 | res->r = NULL; | ||
233 | if (net->ipv4.fib_local && | 234 | if (net->ipv4.fib_local && |
234 | !fib_table_lookup(net->ipv4.fib_local, flp, res, | 235 | !fib_table_lookup(net->ipv4.fib_local, flp, res, |
235 | FIB_LOOKUP_NOREF)) | 236 | FIB_LOOKUP_NOREF)) |