netfilter: nf_queue: hold bridge skb->dev while queued
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ ac28634456867b23b95faccba7997a62ec430603 · < 15d464265120ab9818bd673af301deee09bedab2| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
netfilter: nf_queue: hold bridge skb->dev while queued
br_pass_frame_up() rewrites skb->dev from the ingress port to the bridge master before queueing bridge LOCAL_IN packets. NFQUEUE only holds references on state.in/out and bridge physdevs, so a queued bridge packet can retain a freed bridge master in skb->dev until reinjection.
When the verdict is reinjected later, br_netif_receive_skb() re-enters the receive path with skb->dev still pointing at the freed bridge master, triggering a use-after-free.
Store skb->dev in the queue entry, hold a reference on it for the queue lifetime, and use the saved device when dropping queued packets during NETDEV_DOWN handling.
From the CVE record · Linux
The Linux kernel’s netfilter NFQUEUE can retain a pointer to a freed bridge master device in a queued bridge LOCAL_IN packet. If the device is freed before the packet is reinjected, processing that packet can trigger a use-after-free.
Engineers running Linux kernels that queue bridge LOCAL_IN packets through NFQUEUE should check whether their kernel includes the fix; affected versions were not specified.