Commit 2a8e4997 authored by Ido Schimmel's avatar Ido Schimmel Committed by David S. Miller

net: ipv4: Fix NULL pointer dereference in route lookup

When calculating the multipath hash for input routes the flow info is
not available and therefore should not be used.

Fixes: 24ba1440 ("route: Add multipath_hash in flowi_common to make user-define hash")
Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
Cc: wenxu <wenxu@ucloud.cn>
Acked-by: default avatarwenxu <wenxu@ucloud.cn>
Acked-by: default avatarNikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 04c2632a
...@@ -1820,7 +1820,7 @@ static void ip_multipath_l3_keys(const struct sk_buff *skb, ...@@ -1820,7 +1820,7 @@ static void ip_multipath_l3_keys(const struct sk_buff *skb,
int fib_multipath_hash(const struct net *net, const struct flowi4 *fl4, int fib_multipath_hash(const struct net *net, const struct flowi4 *fl4,
const struct sk_buff *skb, struct flow_keys *flkeys) const struct sk_buff *skb, struct flow_keys *flkeys)
{ {
u32 multipath_hash = fl4->flowi4_multipath_hash; u32 multipath_hash = fl4 ? fl4->flowi4_multipath_hash : 0;
struct flow_keys hash_keys; struct flow_keys hash_keys;
u32 mhash; u32 mhash;
......
Markdown is supported
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