CVE-2026-139094: net: use eth_type_trans_careful() in __dev_forward_skb2()
In the Linux kernel, the following vulnerability has been resolved:
net: use ethtypetranscareful() in devforwardskb2()
A tc egress BPF program can push a tiny link-layer header with bpfskbchangehead() on an skb whose head is almost empty, then redirect it to an Ethernet device ingress. bpfredirectcommon() only checks macheader < networkheader, and devforwardskb2() crashes in ethtypetrans():
tc filter add dev lo egress pref 1 matchall action vlan popeth continue tc filter add dev lo egress pref 2 bpf da obj prog.o # prog: bpfskbchangehead(skb, 1, 0); # return bpfredirect(veth1ifindex, BPFFINGRESS); # AFPACKET SOCKRAW on lo: eth / eth / 8192 bytes of payload
kernel BUG at include/linux/skbuff.h:2839! RIP: 0010:ethtypetrans (include/linux/etherdevice.h:635 net/ethernet/eth.c:163) Call Trace: devforwardskb2 (net/core/dev.c:2507) devforwardskbnomtu (net/core/dev.c:2546) devqueuexmit (net/core/dev.c:4738 net/core/dev.c:4998) packetsendmsg (net/packet/afpacket.c:3157 net/packet/afpacket.c:3189)
Use ethtypetranscareful(), and drop the packet if the Ethernet header can not be pulled. This also covers other devforwardskb() users (veth, macvlan, ipvlan, netdevsim, l2tpeth).
Update the emptyskb BPF selftest: at lwtxmit, BPFPROGTESTRUN strips the Ethernet header, so the "veth ETHHLEN+1" packet is a 1-byte skb. Redirecting it to veth ingress used to read the Ethernet header past skb->tail and deliver a 1-byte frame; it is now dropped with NETRXDROP, as vethxmit() already does at egress.
Affected Software
Event History
Frequently Asked Questions
What conditions are needed to trigger the crash?
The demonstrated trigger uses a tc egress BPF program that calls bpf_skb_change_head() with a one-byte head expansion and redirects the packet to an Ethernet device ingress with BPF_F_INGRESS. It also sends a crafted raw AF_PACKET frame through loopback with nested Ethernet headers and an 8192-byte payload.
What is the practical impact of successful exploitation?
The affected path can reach eth_type_trans() with an Ethernet header that cannot be pulled, causing a kernel BUG. This results in a kernel crash rather than the malformed packet being safely rejected.
What does the fix do when patching is applied?
The fix replaces the unsafe Ethernet protocol handling with eth_type_trans_careful(). Packets whose Ethernet header cannot be pulled are dropped, and the change also covers other dev_forward_skb() users, including veth.