CVE-2026-99112: net/sched: cls_flower: validate mask pointer after nla_next()
In the Linux kernel, the following vulnerability has been resolved:
net/sched: clsflower: validate mask pointer after nlanext()
flsetencopt() iterates the key's nested tunnel-option attributes with nlaforeachattr() while advancing a single mask pointer via nlanext() at the bottom of each loop, so the mask cursor is driven by the number of key attributes rather than by the mask's own attributes. The nlaok() added by commit c96adff956191 ("clsflower: call nlaok() before nlanext()") only validates the mask pointer that was just consumed; the pointer produced by nlanext() is used by the next iteration (flsetgeneveopt() and siblings) without any validation.
The mask's nested attributes are validated with NLVALIDATELIBERAL, which merely warns on trailing bytes that do not form a complete attribute. A mask carrying one valid attribute plus 1-3 residue bytes (or a non-aligned attribute length making mskdepth negative) therefore reaches the next iteration with mskdepth != 0, so neither the !mskdepth check in flsetencopt() nor the !depth check in the per-type helpers fires. nlatype() then reads past the mask payload and nlaparsenesteddeprecated() iterates with an nlalen taken from those bytes, reading well beyond the mask attribute (KASAN: slab-out-of-bounds read in nlavalidateparse from flchange()).
Validate the advanced mask pointer as well: when the mask is not legitimately exhausted (mskdepth != 0) and the new pointer fails nlaok(), reject the filter with -EINVAL. An exactly exhausted mask still skips the check, preserving exact-match behaviour for the remaining key attributes.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
azurelinux/kernelto a version that resolves this vulnerability.Fixed in 6.6.161.1-1 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 6.1.192-1 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 6.12.115-2 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 7.2.13-1 - Upgrade
Upgrade
debian/linux-6.12to a version that resolves this vulnerability.Fixed in 6.12.115-2~deb12u1 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 6.1.192-2Fixed in 6.12.117-1Fixed in 7.2.15-1Fixed in 7.3.4-1 - Upgrade
Upgrade
debian/linux-6.12to a version that resolves this vulnerability.Fixed in 6.12.117-1~deb12u1 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 5.10.273 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 5.15.224 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.1.191 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.6.161 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.12.115 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.18.59 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.2.13 - Compensating control
In fl_set_enc_opt(), validate the mask pointer produced by nla_next(); if the mask is not legitimately exhausted (msk_depth != 0) and the advanced pointer fails nla_ok(), reject the filter with -EINVAL.
Event History
Frequently Asked Questions
What must an attacker be able to do to trigger this issue?
They need to provide crafted nested tunnel-option mask attributes to the cls_flower traffic-control path. The malformed mask can contain a valid attribute followed by 1–3 trailing bytes, or an attribute length that causes the mask depth to become negative.
What is the resulting impact described for affected systems?
The malformed mask can cause nla_type() to read beyond the mask payload, after the mask cursor advances to an unvalidated pointer. Subsequent nested-attribute parsing may then iterate using that invalid data.
Why do existing mask-depth checks not prevent this input?
Liberal nested-attribute validation only warns about trailing bytes that do not make a complete attribute. If residue bytes remain or the depth becomes negative, the zero-depth checks do not fire before the next helper uses the advanced mask pointer.
How is this issue addressed?
The fix validates the mask pointer after nla_next(), before the pointer is used during the following iteration. The referenced stable-kernel commits contain the available fixes.