Skip to content
Commit 97502231 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller
Browse files

udp: ipv4: must add synchronization in udp_sk_rx_dst_set()

Unlike TCP, UDP input path does not hold the socket lock.

Before messing with sk->sk_rx_dst, we must use a spinlock, otherwise
multiple cpus could leak a refcount.

This patch also takes care of renewing a stale dst entry.
(When the sk->sk_rx_dst would not be used by IP early demux)

Fixes: 421b3885

 ("udp: ipv4: Add udp early demux")
Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Cc: Shawn Bohrer <sbohrer@rgmadvisors.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a1bf1750
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment