summaryrefslogtreecommitdiff
path: root/ipc/util.h
diff options
context:
space:
mode:
authorMyungho Jung <mhjungk@gmail.com>2019-02-03 03:56:36 +0300
committerMarcel Holtmann <marcel@holtmann.org>2019-02-04 17:43:46 +0300
commite20a2e9c42c9e4002d9e338d74e7819e88d77162 (patch)
tree6eb84aa6bbd338c29e827c6d6ff0d3f115f4c653 /ipc/util.h
parent017a01ccfbc5a35aed83acbf2ee2735f8c3efe8a (diff)
downloadlinux-e20a2e9c42c9e4002d9e338d74e7819e88d77162.tar.xz
Bluetooth: Fix decrementing reference count twice in releasing socket
When releasing socket, it is possible to enter hci_sock_release() and hci_sock_dev_event(HCI_DEV_UNREG) at the same time in different thread. The reference count of hdev should be decremented only once from one of them but if storing hdev to local variable in hci_sock_release() before detached from socket and setting to NULL in hci_sock_dev_event(), hci_dev_put(hdev) is unexpectedly called twice. This is resolved by referencing hdev from socket after bt_sock_unlink() in hci_sock_release(). Reported-by: syzbot+fdc00003f4efff43bc5b@syzkaller.appspotmail.com Signed-off-by: Myungho Jung <mhjungk@gmail.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'ipc/util.h')
0 files changed, 0 insertions, 0 deletions