netfilter: nf_nat: unregister and release hooks on error
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
6.18.547.2.87.3In the Linux kernel, the following vulnerability has been resolved:
netfilter: nf_nat: unregister and release hooks on error
If nf_hook_entries_insert_raw() fails, the NAT hooks get never released, resulting in a memleak.
Postpone setting nat_proto_net->nat_hook_ops when the hooks are registered to simplify the error path to decide whether the nat hooks need unwinding.
From the CVE record · Linux
The Linux kernel can leak memory when registration of netfilter NAT hooks fails because the hooks are not released. The input does not specify how an attacker could trigger the failure or whether network access, authentication, or user interaction is required.
Teams running Linux kernels should check whether their kernel includes the netfilter NAT hook fix; affected versions are not specified.