Skip to content

Commit

Permalink
net: ipv4: Fix NULL pointer dereference in route lookup
Browse files Browse the repository at this point in the history
When calculating the multipath hash for input routes the flow info is
not available and therefore should not be used.

Fixes: 24ba144 ("route: Add multipath_hash in flowi_common to make user-define hash")
Signed-off-by: Ido Schimmel <[email protected]>
Cc: wenxu <[email protected]>
Acked-by: wenxu <[email protected]>
Acked-by: Nikolay Aleksandrov <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
idosch authored and davem330 committed Mar 2, 2019
1 parent 04c2632 commit 2a8e499
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/ipv4/route.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
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;
u32 mhash;

Expand Down

0 comments on commit 2a8e499

Please sign in to comment.