AZL-118436: CVE-2026-143263 affecting package kernel 6.6.161.1-1
In the Linux kernel, the following vulnerability has been resolved:
netfilter: nat: zero newrange before filling it in
nfnatmasqueradeipv4(), nfnatmasqueradeipv6(), netmaptg4() and netmaptg6() each build a stack-local struct nfnatrange2 from the caller-supplied range, inheriting range->flags unmodified. Two of them only memset() the minaddr/maxaddr members, the other two don't memset() anything at all, so newrange.baseproto is left as stack garbage.
If the inherited flags include NFNATRANGEPROTOOFFSET, nfnatl4protouniquetuple() reads range->baseproto.all to compute the NAT port offset. Neither the NETMAP nor the MASQUERADE targets mask the flags field in their checkentry callback, so this uninitialized stack value can end up feeding the NAT port selection.
The per-member memset()s are not enough: they have to enumerate every field that must be cleared, and baseproto was missed when NFNATRANGEPROTOOFFSET/baseproto was added to the struct. memset() the whole struct instead, so every member is covered regardless of which ones get explicitly assigned afterwards.
There are other places that miss this, but those hardcode .flags so nat core won't read from the uninitialized fields.
C99 initializers would be preferrable, but this is a more intrusive change. Lets followup in nf-next and convert others as well.
This is an LLM finding.
Affected Software
Event History
Frequently Asked Questions
What condition causes the uninitialized value to influence NAT port selection?
The caller-supplied range must have the NF_NAT_RANGE_PROTO_OFFSET flag set. Under that condition, nf_nat_l4proto_unique_tuple() reads newrange.base_proto.all, which may contain uninitialized stack data.
Which NAT rule paths are implicated by this issue?
The affected construction paths are IPv4 and IPv6 MASQUERADE and NETMAP handling: nf_nat_masquerade_ipv4(), nf_nat_masquerade_ipv6(), netmap_tg4(), and netmap_tg6(). Their checkentry callbacks do not mask the flags field.
Why do existing field-specific initializations not prevent the issue?
Some paths clear only min_addr and max_addr, while others do not clear the local range structure. The base_proto member was not initialized, so it can remain stack garbage when later read for protocol-offset processing.