diff options
author | Oliver Hartkopp <socketcan@hartkopp.net> | 2014-01-23 10:19:34 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-02-06 11:08:16 -0800 |
commit | 7dd52e5dcb524d6c4790a415e4d1f47e5bf01616 (patch) | |
tree | f7c7580c83d6b1cd14a4b47b6a8a62c132701756 | |
parent | b5ac52437d8e34ea8032cfa77d6e6aa4b161aeb5 (diff) | |
download | linux-stable-7dd52e5dcb524d6c4790a415e4d1f47e5bf01616.tar.gz linux-stable-7dd52e5dcb524d6c4790a415e4d1f47e5bf01616.tar.bz2 linux-stable-7dd52e5dcb524d6c4790a415e4d1f47e5bf01616.zip |
fib_frontend: fix possible NULL pointer dereference
[ Upstream commit a0065f266a9b5d51575535a25c15ccbeed9a9966 ]
The two commits 0115e8e30d (net: remove delay at device dismantle) and
748e2d9396a (net: reinstate rtnl in call_netdevice_notifiers()) silently
removed a NULL pointer check for in_dev since Linux 3.7.
This patch re-introduces this check as it causes crashing the kernel when
setting small mtu values on non-ip capable netdevices.
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | net/ipv4/fib_frontend.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c index c7629a209f9d..4556cd25acde 100644 --- a/net/ipv4/fib_frontend.c +++ b/net/ipv4/fib_frontend.c @@ -1049,6 +1049,8 @@ static int fib_netdev_event(struct notifier_block *this, unsigned long event, vo } in_dev = __in_dev_get_rtnl(dev); + if (!in_dev) + return NOTIFY_DONE; switch (event) { case NETDEV_UP: |