]> git.baikalelectronics.ru Git - kernel.git/commit
macvlan: enforce a consistent minimal mtu
authorEric Dumazet <edumazet@google.com>
Fri, 7 Oct 2022 22:57:43 +0000 (15:57 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sun, 9 Oct 2022 18:55:05 +0000 (19:55 +0100)
commit301b4e5f7978f36e5fbcf6513ab9a6ea901b4147
tree2343e464899cc52f9cc890caf1857750f03ba306
parent2f1f95f9740486abece514addb7d023c788b1b5e
macvlan: enforce a consistent minimal mtu

macvlan should enforce a minimal mtu of 68, even at link creation.

This patch avoids the current behavior (which could lead to crashes
in ipv6 stack if the link is brought up)

$ ip link add macvlan1 link eno1 mtu 8 type macvlan  # This should fail !
$ ip link sh dev macvlan1
5: macvlan1@eno1: <BROADCAST,MULTICAST> mtu 8 qdisc noop
    state DOWN mode DEFAULT group default qlen 1000
    link/ether 02:47:6c:24:74:82 brd ff:ff:ff:ff:ff:ff
$ ip link set macvlan1 mtu 67
Error: mtu less than device minimum.
$ ip link set macvlan1 mtu 68
$ ip link set macvlan1 mtu 8
Error: mtu less than device minimum.

Fixes: b8d55c187b83 ("net: use core MTU range checking in core net infra")
Reported-by: syzbot <syzkaller@googlegroups.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/macvlan.c