Thread (41 messages) 41 messages, 7 authors, 2014-07-25

Re: [PATCH net] ipv4: fix dst race in sk_dst_get()

From: David Miller <davem@davemloft.net>
Date: 2014-06-26 00:42:17

From: Eric Dumazet <redacted>
Date: Tue, 24 Jun 2014 10:05:11 -0700
From: Eric Dumazet <edumazet@google.com>

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 <redacted>
Applied and queued up for -stable, thanks Eric.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help