CVE-2026-98096: ipv6: sr: restore network header before routing and forwarding
In the Linux kernel, the following vulnerability has been resolved:
ipv6: sr: restore network header before routing and forwarding
ipv6srhrcv() runs with skb->data at the Segment Routing Header (SRH) while skbnetworkheader() points at the IPv6 header.
When segmentsleft > 0, ipv6srhrcv() previously restored the skb->data position by pushing sizeof(struct ipv6hdr), assuming the SRH immediately followed the fixed IPv6 header. If another extension header (such as a Hop-by-Hop options header) precedes the SRH, skbnetworkoffset() remained negative.
This led to two problems: 1. During ip6routeinput(), fib6rulesearlyflowdissect() invokes skbflowdissect() which passes the negative skbnetworkoffset() to flow dissection, breaking BPF and C flow dissector logic. 2. If forwarded via ip6forward() or redirected via actmirred, downstream handlers (like schfragment() or neighbour output) pass the negative offset as an unsigned length, triggering OOB memcpy or buffer overflows.
Fix this by pushing -skbnetworkoffset(skb) before routing, ensuring skbnetworkoffset(skb) is 0 for route lookup / flow dissection as well as downstream forwarding. On the loopback path, pull skbtransportoffset(skb) to restore skb->data to the SRH before looping back.
Affected Software
Event History
Frequently Asked Questions
What traffic pattern is required to trigger the issue?
The packet must be processed by IPv6 Segment Routing with segments_left greater than zero, and an IPv6 extension header such as a Hop-by-Hop options header must appear before the Segment Routing Header. The faulty header restoration occurs when that packet is routed or forwarded.
Which paths can turn the bad offset into a security-relevant memory operation?
Route input can pass the negative network offset to flow dissection, affecting BPF and C flow dissector logic. Forwarding through ip6_forward() or redirection through act_mirred can pass it as an unsigned length to downstream handlers, potentially causing out-of-bounds memcpy operations or buffer overflows.
Are systems only doing local routing affected, or is forwarding required?
Local route lookup and flow dissection can be affected before forwarding. The described out-of-bounds copy and buffer-overflow risk arises on forwarding or act_mirred redirection paths that reach downstream handlers such as sch_fragment() or neighbour output.