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

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

From: David Miller <davem@davemloft.net>
Date: 2017-03-16 18:16:48

From: Kevin Xu <redacted>
Date: Thu, 16 Mar 2017 01:08:30 -0700
In some rare cases, inet_sk_rx_dst_set() may be called multiple times
on the same dst, causing reference count leakage. Eventually, it
prevents net_device to be destroyed. The bug then manifested as

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

in the kernel log, preventing new network namespace creation.

The patch works around the issue by checking whether the socket already
has the same dst set.

Signed-off-by: Kevin Xu <redacted>
You need to prevent this parallel execution of this function or use
atomic compare-and-exchange to set the rx_dst in order to prevent
the double refcounting.

This patch by itself is even worse than a workaround, because depending
upon how the compiler reloads values from memory, the problem can still
occur.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help