Message ID | 20240711214642.133844-2-vinicius.peixoto@canonical.com |
---|---|
State | New |
Headers | show |
Series | CVE-2024-36901 | expand |
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c index 3b1efab423b8b..341d6d6934c99 100644 --- a/net/ipv6/ip6_output.c +++ b/net/ipv6/ip6_output.c @@ -221,7 +221,7 @@ int ip6_output(struct net *net, struct sock *sk, struct sk_buff *skb) skb->protocol = htons(ETH_P_IPV6); skb->dev = dev; - if (unlikely(idev->cnf.disable_ipv6)) { + if (unlikely(!idev || idev->cnf.disable_ipv6)) { IP6_INC_STATS(net, idev, IPSTATS_MIB_OUTDISCARDS); kfree_skb(skb); return 0;