netfilter: bpf: reject invalid NAT manipulation types
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 0fabd2aa199faeb8754aee94658f2c48ccb2c8c3 · < 16d464013ec2267b00a83f4bfbb97b3ecc63bfa7| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
netfilter: bpf: reject invalid NAT manipulation types
As bpf_ct_set_nat_info() is not validating the NAT manipulation type a wrong value can be passed directly to nf_nat_setup_info(). This triggers the WARN_ON() at nf_nat_setup_info() and if panic_on_warn isn't set, then IPS_SRC_NAT_DONE is set without adding nat_bysource and conntrack cleanup tries to unlink an uninitialized hlist node.
Fix this by checking that NAT manipulation type is correct before calling nf_nat_setup_info(). In addition, if the WARN_ON is hit, return NF_DROP instead of continuing with the processing to avoid similar situations in the future.
From the CVE record · Linux
The Linux kernel’s netfilter BPF code does not validate the NAT manipulation type passed to bpf_ct_set_nat_info(). An invalid value triggers a warning and, if panic_on_warn is disabled, can leave conntrack cleanup trying to unlink an uninitialized node. The input does not specify the access or user interaction needed to trigger this.
Engineers running Linux kernels with netfilter BPF should check their exposure; affected versions are not specified.