Thread (15 messages) flat view 15 messages, 5 authors, 2017-03-20

Re: [PATCH net v2] net: Do not hold the reference for the same sk_rx_dst

From: Cong Wang <hidden>
Date: 2017-03-19 03:50:05

On Sat, Mar 18, 2017 at 6:48 PM, Kevin Xu [off-list ref] wrote:
In some rare cases, inet_sk_rx_dst_set() may be called multiple times
on the same dst, causing double refcounting. Eventually, it
prevents net_device to be destroyed. The bug manifested as

unregister_netdevice: waiting for lo to become free. Usage count = 1

in the kernel log, preventing new network namespace creation.

Signed-off-by: Kevin Xu <redacted>
Don't know why you don't follow the discussion on your v1...

It is protected by bh_lock_sock(), so your patch is not needed
at all.

Read net/ipv4/udp.c:

1762 /* For TCP sockets, sk_rx_dst is protected by socket lock
1763  * For UDP, we use xchg() to guard against concurrent changes.
1764  */
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help