netfilter: nft_tunnel: fix use-after-free on object destroy
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ af308b94a2a4a5a27bec9028354c4df444a7c8ba · < 941d7394efda5e054e2d6f3e0dd0f6a9ba19aaa3| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
netfilter: nft_tunnel: fix use-after-free on object destroy
nft_tunnel_obj_destroy() calls metadata_dst_free() which directly kfree()s the metadata_dst, ignoring the dst_entry refcount. Packets that took a reference via dst_hold() in nft_tunnel_obj_eval() and are still queued (e.g. in a netem qdisc) are left with a dangling pointer. When these packets are eventually dequeued, dst_release() operates on freed memory.
Replace metadata_dst_free() with dst_release() so the metadata_dst is freed only after all references are dropped. The dst subsystem already handles metadata_dst cleanup in dst_destroy() when DST_METADATA is set.
From the CVE record · Linux
The Linux kernel’s netfilter nft_tunnel code has a use-after-free when a tunnel object is destroyed while packets holding a reference remain queued. Dequeuing those packets can access freed memory. The input does not specify attacker access requirements or whether user interaction is needed.
Engineers running the Linux kernel should check whether their build includes the affected netfilter nft_tunnel code; affected versions are not specified.