]> git.baikalelectronics.ru Git - kernel.git/commit
tipc: orphan sock in tipc_release()
authorCong Wang <xiyou.wangcong@gmail.com>
Tue, 4 Sep 2018 02:12:41 +0000 (19:12 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 6 Sep 2018 05:14:00 +0000 (22:14 -0700)
commit1b39fc9f9e0c95054dc2db4612614a04512795e2
tree8dcd50c6f0a21d53352fc53dc828ebb8a180dc27
parent806fbb0cbbb6e8490f0050790a1865e0a77f5487
tipc: orphan sock in tipc_release()

Before we unlock the sock in tipc_release(), we have to
detach sk->sk_socket from sk, otherwise a parallel
tipc_sk_fill_sock_diag() could stil read it after we
free this socket.

Fixes: e9a4ef2a0a6e ("tipc: implement socket diagnostics for AF_TIPC")
Reported-and-tested-by: syzbot+48804b87c16588ad491d@syzkaller.appspotmail.com
Cc: Jon Maloy <jon.maloy@ericsson.com>
Cc: Ying Xue <ying.xue@windriver.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Acked-by: Ying Xue <ying.xue@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tipc/socket.c