Skip to content

Commit

Permalink
fib_frontend: fix possible NULL pointer dereference
Browse files Browse the repository at this point in the history
The two commits 0115e8e (net: remove delay at device dismantle) and
748e2d9 (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 <[email protected]>
Acked-by: Eric Dumazet <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
hartkopp authored and davem330 committed Jan 24, 2014
1 parent 322b1f7 commit a0065f2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions net/ipv4/fib_frontend.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit a0065f2

Please sign in to comment.