net: mpls: clear inner_protocol when the last label is popped
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 48d2ab609b6bbecb7698487c8579bc40de9d6dfa · < da8c3a7f5d3137fec4ff60a6248f5f6d66b6a63e| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
net: mpls: clear inner_protocol when the last label is popped
skb_mpls_push() records the pre-encapsulation network header once, gated on !skb->inner_protocol. skb_mpls_pop() never clears that record, so it outlives the encapsulation it describes.
Open vSwitch can then re-push MPLS onto a packet whose inner_network_header still points at the older, deeper offset: push a label, pop every label, recirculate (ovs_flow_key_update() re-derives key->eth.type and resets network_header, but leaves inner_*), then push again. ovs_fragment() trusts the record:
skb->network_header = skb->inner_network_header;
so skb_network_offset() goes negative. The bound check is signed:
if (skb_network_offset(skb) > MAX_L2_LEN)
a negative offset passes it, and prepare_frag() widens the value:
From the CVE record · Linux
The Linux kernel can retain a stale inner network header after all MPLS labels are popped. If Open vSwitch recirculates the packet, pushes another label, and fragments it, the stale offset can cause an oversized kernel memory copy and a crash. The input does not specify the access or authentication needed to trigger this packet sequence.
Engineers running Linux kernels with MPLS and Open vSwitch packet handling should check their versions; the issue was reproduced on v7.3-rc1.