ipv6: fix panic when forwarding a pkt with no in6 dev
authorNicolas Dichtel <nicolas.dichtel@6wind.com>
Fri, 8 Apr 2022 14:03:42 +0000 (16:03 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Apr 2022 07:34:19 +0000 (09:34 +0200)
commitadee01bbf6cb5b3e4ed08be8ff866aac90f13836
tree217bef177bdb1c26d7e2c01512b1ab115c571fa2
parentcab64cb82fe1a2436bb7991cb628d76de3c44751
ipv6: fix panic when forwarding a pkt with no in6 dev

commit e3fa461d8b0e185b7da8a101fe94dfe6dd500ac0 upstream.

kongweibin reported a kernel panic in ip6_forward() when input interface
has no in6 dev associated.

The following tc commands were used to reproduce this panic:
tc qdisc del dev vxlan100 root
tc qdisc add dev vxlan100 root netem corrupt 5%

CC: stable@vger.kernel.org
Fixes: ccd27f05ae7b ("ipv6: fix 'disable_policy' for fwd packets")
Reported-by: kongweibin <kongweibin2@huawei.com>
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/ipv6/ip6_output.c