CVE-2026-98532: ipv6: do not let ipv6_find_hdr() return an offset past the packet end
In the Linux kernel, the following vulnerability has been resolved:
ipv6: do not let ipv6findhdr() return an offset past the packet end
ipv6findhdr() walks the extension header chain, skipping each header by the length that header itself declares. ipv6optlen() returns up to 2048, and the skip is never checked against skb->len, so the offset stored in offset can point past the end of the packet.
openvswitch installs that offset as the transport header, and updateipv6checksum() then reads and writes the transport checksum field out of bounds:
BUG: KASAN: slab-use-after-free in inetprotocsumreplace16+0x445/0x470 Read of size 2 at addr ffff88810b754b06 by task ovsipv6oob/629 CPU: 4 UID: 1000 PID: 629 Comm: ovsipv6oob Tainted: G N 7.3.0-rc3+ #348 Call Trace: inetprotocsumreplace16+0x445/0x470 setipv6addr+0x3dd/0x460 doexecuteactions+0x6a3d/0x7c40 ovsexecuteactions+0xfd/0x480 ovspacketcmdexecute+0xc38/0xf20 genlrcvmsg+0x59e/0x870 netlinkrcvskb+0x18b/0x450 genlrcv+0x2d/0x40 netlinkunicast+0x6bc/0xa20
The buggy address belongs to the object at ffff88810b754980 which belongs to the cache skbuffsmallhead of size 704 The buggy address is located 390 bytes inside of freed 704-byte region [ffff88810b754980, ffff88810b754c40)
Other callers use that offset too, so bound it here rather than in one caller.
Reject a header whose declared length does not fit in the packet. ipv6findhdr() already fails with -EBADMSG on a malformed chain, so this adds no new failure mode.