icmp6: Fix null-ptr-deref of ip6_null_entry->rt6i_idev in icmp6_dev().
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 4832c30d5458387ff2533ff66fbde26ad8bb5a2d · < aa657d319e6c7502a4eb85cc0ee80cc81b8e5724| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
icmp6: Fix null-ptr-deref of ip6_null_entry->rt6i_idev in icmp6_dev().
With some IPv6 Ext Hdr (RPL, SRv6, etc.), we can send a packet that has the link-local address as src and dst IP and will be forwarded to an external IP in the IPv6 Ext Hdr.
For example, the script below generates a packet whose src IP is the link-local address and dst is updated to 11::.
# for f in $(find /proc/sys/net/ -name *seg6_enabled*); do echo 1 > $f; done # python3 >>> from socket import * >>> from scapy.all import * >>> >>> SRC_ADDR = DST_ADDR = "fe80::5054:ff:fe12:3456" >>> >>> pkt = IPv6(src=SRC_ADDR, dst=DST_ADDR) >>> pkt /= IPv6ExtHdrSegmentRouting(type=4, addresses=["11::", "22::"], segleft=1) >>> >>> sk = socket(AF_INET6, SOCK_RAW, IPPROTO_RAW) >>> sk.sendto(bytes(pkt), (DST_ADDR, 0))
For such a packet, we call ip6_route_input() to look up a route for the next destination in these three functions depending on the header type.
* ipv6_rthdr_rcv() * ipv6_rpl_srh_rcv() * ipv6_srh_rcv()
If no route is found, ip6_null_entry is set to skb, and the following dst_input(skb) calls ip6_pkt_drop().
From the CVE record · Linux
The Linux kernel can dereference a null pointer in icmp6_dev() while handling an IPv6 packet with an extension header. A crafted packet can trigger a kernel crash when forwarding changes its destination and no route is found. The provided reproduction sends the packet locally using a raw socket; the input does not establish whether it can be triggered remotely or requires authentication.
Engineers running Linux kernels with IPv6 extension-header handling should check their deployments; affected versions are not specified.