]> git.baikalelectronics.ru Git - kernel.git/commit
tipc: avoid packets leaking on socket receive queue
authorYing Xue <ying.xue@windriver.com>
Sun, 22 Nov 2015 07:46:05 +0000 (15:46 +0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 24 Nov 2015 04:45:15 +0000 (23:45 -0500)
commit1f8ab000113d9bc80683ca15f0de1696d422c8b5
tree24c560dbc1ff6913630583db925d07ae292f55b1
parent575c27371c3d7e2177164694be83015217751494
tipc: avoid packets leaking on socket receive queue

Even if we drain receive queue thoroughly in tipc_release() after tipc
socket is removed from rhashtable, it is possible that some packets
are in flight because some CPU runs receiver and did rhashtable lookup
before we removed socket. They will achieve receive queue, but nobody
delete them at all. To avoid this leak, we register a private socket
destructor to purge receive queue, meaning releasing packets pending
on receive queue will be delayed until the last reference of tipc
socket will be released.

Signed-off-by: Ying Xue <ying.xue@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tipc/socket.c