Re: [PATCH] Bluetooth: Fix l2cap_sock_teardown_cb race condition with bt_accept_dequeue

2016-05-13 Thread Yichen Zhao
Hi Marcel, > so I am not big fan of the conditional locking in case of parent is set or > not. Do you have a test case that reproduces the mentioned race. It would > love to have that in tools/l2cap-tester or similar. So far I could only reproduce the bug by repeatedly performing RFCOMM connec

Re: [PATCH] Bluetooth: Fix l2cap_sock_teardown_cb race condition with bt_accept_dequeue

2016-05-13 Thread Marcel Holtmann
Hi Yichen, > Fix a race condition between l2cap_sock_teardown_cb on an L2CAP socket > and bt_accept_dequeue on its parent socket. When the race condition is > encountered bt_accept_dequeue may call bt_accept_unlink on an already > unlinked socket and result in a NULL pointer dereference. > > Even

[PATCH] Bluetooth: Fix l2cap_sock_teardown_cb race condition with bt_accept_dequeue

2016-05-09 Thread Yichen Zhao
Fix a race condition between l2cap_sock_teardown_cb on an L2CAP socket and bt_accept_dequeue on its parent socket. When the race condition is encountered bt_accept_dequeue may call bt_accept_unlink on an already unlinked socket and result in a NULL pointer dereference. Even if bt_accept_unlink is