Re: [PATCH net] openvswitch: reject negative L2 length in ovs_fragment()

From
Jiri Benc <hidden>
Date
2026-11-26 09:14:24
Also in
stable
Reply to
Lin Jiapeng, 2026-11-26
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
Thread (4 messages) 4 messages, 2 authors, last reply 14h ago
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help