Re: [PATCH net] net: ipv4: Don't crash if passing a null sk to ip_do_redirect.

2016-12-22 Thread David Miller
From: Lorenzo Colitti Date: Fri, 23 Dec 2016 00:33:57 +0900 > Commit e2d118a1cb5e ("net: inet: Support UID-based routing in IP > protocols.") made ip_do_redirect call sock_net(sk) to determine > the network namespace of the passed-in socket. This crashes if sk > is NULL. > > Fix this by getting

[PATCH net] net: ipv4: Don't crash if passing a null sk to ip_do_redirect.

2016-12-22 Thread Lorenzo Colitti
Commit e2d118a1cb5e ("net: inet: Support UID-based routing in IP protocols.") made ip_do_redirect call sock_net(sk) to determine the network namespace of the passed-in socket. This crashes if sk is NULL. Fix this by getting the network namespace from the skb instead. Fixes: e2d118a1cb5e ("net: in