diff options
author | Eric Dumazet <edumazet@google.com> | 2014-06-24 10:05:11 -0700 |
---|---|---|
committer | Jiri Slaby <jslaby@suse.cz> | 2014-07-29 16:56:59 +0200 |
commit | 591b1e1bb40152e22cee757f493046a0ca946bf8 (patch) | |
tree | 70318ea1097beeb049d088598e39323eac55212d /Documentation/w1 | |
parent | 1ea464333aa10210b8b285a8a64ce17211569156 (diff) | |
download | linux-rt-591b1e1bb40152e22cee757f493046a0ca946bf8.tar.gz |
ipv4: fix dst race in sk_dst_get()
[ Upstream commit f88649721268999bdff09777847080a52004f691 ]
When IP route cache had been removed in linux-3.6, we broke assumption
that dst entries were all freed after rcu grace period. DST_NOCACHE
dst were supposed to be freed from dst_release(). But it appears
we want to keep such dst around, either in UDP sockets or tunnels.
In sk_dst_get() we need to make sure dst refcount is not 0
before incrementing it, or else we might end up freeing a dst
twice.
DST_NOCACHE set on a dst does not mean this dst can not be attached
to a socket or a tunnel.
Then, before actual freeing, we need to observe a rcu grace period
to make sure all other cpus can catch the fact the dst is no longer
usable.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: Dormando <dormando@rydia.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Diffstat (limited to 'Documentation/w1')
0 files changed, 0 insertions, 0 deletions