CVE-2026-143356: bpf: Move the MAC header in bpf_lwt_seg6_adjust_srh()
In the Linux kernel, the following vulnerability has been resolved:
bpf: Move the MAC header in bpflwtseg6adjustsrh()
bpfskbnethdrpush() and bpfskbnethdrpop() change skb->data and skb->macheader by len. That is correct in a tc prog, where skb->data is the MAC header. But bpflwtseg6adjustsrh() calls them in an End.BPF prog, where skb->data is the network header. The MAC header does not move:
before push | free | MAC header | IPv6 | SRH | payload ^ head ^ macheader ^ data today | free | MAC h| IPv6 | SRH + len | payload ^ head ^ macheader ^ data this patch | free | MAC header | IPv6 | SRH + len | payload ^ head ^ macheader ^ data
Users of skbmacheader() get incorrect bytes until devqueuexmit() sets skb->macheader again. skbcowhead() reserves only len bytes. Thus the 16-bit offset skb->macheader can wrap. A push also changes the "not set" value. In both cases skbmacheader() points after the skb.
Move the MAC header too. Pass len + skb->maclen to skbcowhead(). Keep the "not set" value. The second Fixes tag is for this case. Since that commit an End.BPF prog can get an skb with skb->macheader not set.
Affected Software
Event History
Frequently Asked Questions
Which deployments are exposed to this issue?
The issue applies to Linux kernel deployments that run an End.BPF program using bpf_lwt_seg6_adjust_srh(). The affected execution context is End.BPF, where skb->data points to the network header rather than the MAC header.
What must occur for the faulty state to be triggered?
An End.BPF program must adjust an SRH in a way that invokes the network-header push or pop handling. This can leave skb->mac_header incorrectly shifted, including when the MAC-header offset wraps or when its “not set” value is changed.
What is the practical effect of the malformed packet metadata?
Code using skb_mac_header() can receive incorrect bytes or a pointer beyond the skb until __dev_queue_xmit() resets skb->mac_header. The fix moves the MAC header appropriately, reserves space for the adjustment plus the MAC-header length, and preserves the “not set” state.