CVE-2026-143342: net: stmmac: fix VLAN tag stripping on short and non-linear RX frames

Published Dec 3, 2026
·
Updated

In the Linux kernel, the following vulnerability has been resolved:

net: stmmac: fix VLAN tag stripping on short and non-linear RX frames

stmmacrxvlan() reads the VLAN header straight from skb->data and removes it with skbpull(), assuming the header is fully present in the linear part of the skb. XDP can change the frame length and head layout before the tag is stripped.

An XDP program can use bpfxdpadjusttail() to shrink a frame to as little as ETHHLEN while bytes 12-13 still contain a VLAN ethertype. The driver then reads hvlanTCI past skb->len and pops the tag, leaving less than ETHHLEN in the skb. ethtypetrans() cannot pull the MAC header, so a malformed skb is passed up. The TCI is also read from the wrong place when the tag is not fully in the linear head, e.g. when it spans into a frag.

Read hvlanproto after pulling ETHHLEN into the linear part, and check it together with the device features. Only if the tag is actually going to be popped, pull VLANETHHLEN and re-derive the header pointer afterwards, as pskbmaypull() may reallocate the skb head. Return an error so the callers can drop a frame that claims a VLAN tag but cannot provide the full header. This also drops and counts frames shorter than ETHHLEN in rxdropped, even when VLAN RX offload is disabled; bpfxdpadjusthead() and bpfxdpadjusttail() cannot produce such a frame, so it only affects a runt that reaches the driver, and dropping it is safer than handing it to ethtypetrans().

Also move the XDP metadata written with bpfxdpadjustmeta() together with the MAC header when the tag is popped, so datameta still points at the metadata after ethtypetrans() anchors macheader, instead of at the first bytes of the destination MAC.

Affected Software

1 affected component
Linux Linux kernel

Event History

Dec 3, 2026
CVE Published
via MITRE·09:22 AM
Data Sourced
via MITRE·09:22 AM
Description

Frequently Asked Questions

1

What conditions are needed to trigger the malformed-frame path?

The described case requires the stmmac receive path to process a frame whose bytes 12-13 indicate a VLAN ethertype after XDP has altered the frame. An XDP program can use bpf_xdp_adjust_tail() to shrink the frame to ETH_HLEN before VLAN stripping occurs.

2

Can non-linear received packets also be affected?

Yes. The VLAN TCI can be read from the wrong location when the VLAN header is not wholly in the linear skb head, such as when part of it resides in a fragment.

3

What is the intended handling for a frame that claims a VLAN tag but lacks a complete VLAN header?

The corrected behavior is to return an error so callers can drop the frame. VLAN stripping should occur only after ensuring VLAN_ETH_HLEN can be pulled into the linear skb area.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203