]> git.baikalelectronics.ru Git - kernel.git/commit
udp: ipv4: must add synchronization in udp_sk_rx_dst_set()
authorEric Dumazet <edumazet@google.com>
Wed, 11 Dec 2013 22:46:51 +0000 (14:46 -0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 12 Dec 2013 01:21:10 +0000 (20:21 -0500)
commit3eb3dc0244eecc1620e71f97ed8220879297bc17
tree2658e9259ca6a53e07a25fe399a4f61d15093220
parent78a9cb185608cf0f9e037a7f35621b0e5255d4eb
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: f6730a094d56 ("udp: ipv4: Add udp early demux")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Shawn Bohrer <sbohrer@rgmadvisors.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/udp.c