KernelScan.io

HIGH Introduced in 4.20

flow_dissector Hlen Truncation

CVE-2026-98950

CVSS 7.3 / 10.0 KernelScan AI

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L

01

In the Linux kernel, the following vulnerability has been resolved: flow_dissector: avoid u16 truncation of hlen in bpf_flow_dissect() bpf_flow_dissect() sanitizes the offsets returned by the BPF program with clamp_t(u16, ..., hlen). If hlen is bigger than 65535, the upper bound is truncated before the comparison. For instance, with hlen == 65536, both nhoff and thoff are forced to zero, even if the program returned sane values. This is the same class of bug as the one fixed in commit 99bda1ecbd56 ("flow_dissector: avoid u16 truncation of skb->len when computing thoff"). That fix does not cover the BPF path, because __skb_flow_dissect() returns early when a BPF flow dissector handles the packet. struct bpf_flow_keys stores nhoff and thoff as u16, so cap hlen to U16_MAX before clamping. Found by sashiko while reviewing the commit above.

02

Engine v0.9.0

Risk summary

Systems with a BPF flow dissector program attached to a network-facing interface can be triggered by a remote attacker sending a crafted packet with a header length exceeding 65,535 bytes. This causes the flow dissector to discard valid BPF program results and force network and transport header offsets to zero, potentially leading to packet misclassification, firewall bypass, or degraded packet processing.

Affectednet/core/flow_dissector.c (flow_dissector)

Vulnerability analysis

The BPF flow dissector sanitizes offsets returned by a BPF program using a clamp operation with the packet header length (hlen) as the upper bound. Because the clamp casts hlen to a 16-bit integer before comparing, any hlen value above 65,535 truncates to a small number (e.g., 65,536 becomes 0), causing the clamp to incorrectly force both the network and transport header offsets to zero even when the BPF program supplied correct values. The fix caps hlen at U16_MAX before the clamp, preserving the program's valid offsets. The bug is reachable whenever a BPF flow dissector is loaded — which requires CAP_BPF or CAP_SYS_ADMIN — and a packet with an oversized header length is received, making internet-facing or LAN-facing deployments with XDP, tc, or similar BPF-based flow dissection the primary exposure.

03

BranchIntroducedFixed inPatch commit
5.104.205.10.27346d21495f633
5.154.205.15.2246267f8304cbd
6.14.206.1.19199c590621726
6.124.206.12.1133fb5ad2951a6
6.184.206.18.57cc18eb0e9941
6.64.206.6.160c44c02c930c6
7.24.207.2.1161b43a51a559
mainline4.207.3f202578efc73
cip/6.124.206.12.114-cip343fb5ad2951a6

04

State of the newest release of each Civil Infrastructure Platform SLTS tree, from CIP's own fix records.

CIP treeState
cip/6.12Fixed in 6.12.114-cip34
cip/6.1Affected — no CIP fix yet (latest 6.1.190-cip62)
cip/6.1-rtAffected — no CIP fix yet (latest 6.1.189-cip61-rt32)
cip/5.10Affected — no CIP fix yet (latest 5.10.272-cip79)
cip/5.10-rtAffected — no CIP fix yet (latest 5.10.272-cip79-rt35)