netfilter: revalidate bridge ports
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ f350a0a87374418635689471606454abc7beaa3a · < ccb9fd4b87538ccf19ccff78ee26700526d94867| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
netfilter: revalidate bridge ports
ebt_redirect_tg() dereferences br_port_get_rcu() return without a NULL check, causing a kernel panic when the bridge port has been removed between the original hook invocation and an NFQUEUE reinject.
A mere NULL check isn't sufficient, however. As sashiko review points out userspace can not only remove the port from the bridge, it could also place the device in a different virtual device, e.g. macvlan.
If this happens, we must drop the packet, there is no way for us to reinject it into the bridge path.
Switch to _upper API, we don't need the bridge port structure. Also, this fix keeps another bug intact:
Both nfnetlink_log and nfnetlink_queue use CONFIG_BRIDGE_NETFILTER too aggressive, which prevents certain logging features when queueing in bridge family: NETFILTER_FAMILY_BRIDGE can be enabled while the old CONFIG_BRIDGE_NETFILTER cruft is off.
Fixes tag is a common ancestor, this was always broken.
From the CVE record · Linux
The Linux kernel’s netfilter bridge redirect can dereference a missing bridge port and panic. This can happen if userspace removes the port from the bridge between the original hook invocation and an NFQUEUE reinjection; the input does not specify whether authentication or user interaction is required.
Engineers running Linux kernels that use netfilter bridge redirect and NFQUEUE should check their kernel versions; affected versions are not specified.