netfilter: nf_tables: release flowtable after rcu grace period on error
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 3b49e2e94e6ebb8b23d0955d9e898254455734f8 · < c8092edb9a11f20f95ccceeb9422b7dd0df337bd| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
netfilter: nf_tables: release flowtable after rcu grace period on error
Call synchronize_rcu() after unregistering the hooks from error path, since a hook that already refers to this flowtable can be already registered, exposing this flowtable to packet path and nfnetlink_hook control plane.
This error path is rare, it should only happen by reaching the maximum number hooks or by failing to set up to hardware offload, just call synchronize_rcu().
There is a check for already used device hooks by different flowtable that could result in EEXIST at this late stage. The hook parser can be updated to perform this check earlier to this error path really becomes rarely exercised.
Uncovered by KASAN reported as use-after-free from nfnetlink_hook path when dumping hooks.
From the CVE record · Linux
A rare error while setting up an nf_tables flowtable can free it before existing hooks stop referring to it. This can cause a use-after-free when hooks are dumped through nfnetlink_hook. The input does not establish the access or authentication needed to trigger the issue.
Engineers running Linux kernels with netfilter nf_tables should check their kernel version against the vendor advisory; affected versions are not specified here.