Skip to content

Commit a0065f2

Browse files
hartkoppdavem330
authored andcommitted
fib_frontend: fix possible NULL pointer dereference
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 <socketcan@hartkopp.net> Acked-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 322b1f7 commit a0065f2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

net/ipv4/fib_frontend.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1047,6 +1047,8 @@ static int fib_netdev_event(struct notifier_block *this, unsigned long event, vo
10471047
}
10481048

10491049
in_dev = __in_dev_get_rtnl(dev);
1050+
if (!in_dev)
1051+
return NOTIFY_DONE;
10501052

10511053
switch (event) {
10521054
case NETDEV_UP:

0 commit comments

Comments
 (0)