On Thu, 26 Nov 2026 16:31:41 +0800, Lin Jiapeng wrote:
From: Lin Jiapeng <redacted>
ovs_fragment() refragments MPLS packets from their inner network header
and saves the L2 header in a MAX_L2_LEN-byte buffer before fragmenting.
POP_MPLS can leave inner_network_header behind skb->data. The signed
offset is then negative and passes the "> MAX_L2_LEN" check, so
prepare_frag() widens it to 0xfffffffc for memcpy() into l2_data. An
unprivileged user can trigger this on both IPv4 and IPv6 paths. KASAN
reports:
BUG: KASAN: slab-out-of-bounds in prepare_frag+0x3c2/0x4c0
Read of size 4294967292 at addr ff110001059cf044 by task
ovs_frag_trigge/132
__asan_memcpy+0x23/0x60
prepare_frag+0x3c2/0x4c0
ovs_fragment+0x578/0x860
Reject a negative offset together with an oversized one and drop the
packet through OVS_DROP_FRAG_L2_TOO_LONG. Valid offsets are unchanged.
This was supposed to be fixed by
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=78a86d75a70e1e227711c72865c59b1422d0a5ae
What kernel did you reproduce this on?
Jiri