Skip to content

Commit 2a8e499

Browse files
idoschdavem330
authored andcommitted
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: 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]>
1 parent 04c2632 commit 2a8e499

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/ipv4/route.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1820,7 +1820,7 @@ static void ip_multipath_l3_keys(const struct sk_buff *skb,
18201820
int fib_multipath_hash(const struct net *net, const struct flowi4 *fl4,
18211821
const struct sk_buff *skb, struct flow_keys *flkeys)
18221822
{
1823-
u32 multipath_hash = fl4->flowi4_multipath_hash;
1823+
u32 multipath_hash = fl4 ? fl4->flowi4_multipath_hash : 0;
18241824
struct flow_keys hash_keys;
18251825
u32 mhash;
18261826

0 commit comments

Comments
 (0)