Netdev List
 help / color / mirror / Atom feed
* [PATCH stable 3.7+] fib_frontend: fix possible NULL pointer dereference
@ 2014-01-23  9:19 Oliver Hartkopp
  2014-01-23 12:26 ` Eric Dumazet
  2014-01-24 23:52 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Oliver Hartkopp @ 2014-01-23  9:19 UTC (permalink / raw)
  To: Eric Dumazet, David Miller, Linux Netdev List

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>

---

diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c
index d846304..c7539e2 100644
--- a/net/ipv4/fib_frontend.c
+++ b/net/ipv4/fib_frontend.c
@@ -1047,6 +1047,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:

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-01-24 23:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-23  9:19 [PATCH stable 3.7+] fib_frontend: fix possible NULL pointer dereference Oliver Hartkopp
2014-01-23 12:26 ` Eric Dumazet
2014-01-24 23:52 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox