ip: orphan prefetched skbs before multicast forwarding
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ cf7fbe660f2dbd738ab58aea8e9b0ca6ad232449 · < e36ce6e78fe3fc3c071a26750783b7ba081ce10d| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
ip: orphan prefetched skbs before multicast forwarding
IPv4 and IPv6 input preserve an skb->sk association installed by bpf_sk_assign() so that local delivery can use the selected socket under RCU. Both address families can also prefetch a socket in UDP early demux. In both paths (BPF and UDP early demux) a reference is not guaranteed to be held on the socket.
When a multicast packet is not locally deliverable, IPv6 hands the original skb to ip6_mr_input(). IPv4's ip_mr_input() similarly keeps the original skb when local delivery is not needed. Either path can put the skb on an unresolved multicast route queue or forward it after the receive-side RCU section ends.
After the prefetched socket is destroyed, a later skb free invokes sock_pfree() and dereferences the stale skb->sk. Orphan the skb before each non-local multicast forwarding path. Local delivery retains the original skb; the existing skb_clone() calls provide multicast forwarding with a socket-free clone.
From the CVE record · Linux
The Linux kernel can retain a socket association without holding a reference when BPF socket assignment or UDP early demux handles an IPv4 or IPv6 packet. If a multicast packet is forwarded or queued without local delivery and the socket is destroyed, freeing the packet later can dereference the stale socket pointer. The input does not specify authentication or user-interaction requirements.
Engineers running the Linux kernel should check their versions; affected versions are not specified.