lkml.org 
[lkml]   [2017]   [Oct]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] Bluetooth: hci_ldisc: Fix another race when closing the tty.
From
Date
Hi Ronald,

> The following race condition still existed:
>
> P1 P2
> cancel_work_sync()
> hci_uart_tx_wakeup()
> hci_uart_write_work()
> hci_uart_dequeue()
> clear_bit(HCI_UART_PROTO_READY)
> hci_unregister_dev(hdev)
> hci_free_dev(hdev)
> hu->proto->close(hu)
> kfree(hu)
> access to hdev and hu
>
> Cancelling the work after clearing the HCI_UART_PROTO_READY bit avoids
> this as any hci_uart_tx_wakeup() issued after the flag is cleared will
> detect that and not schedule further work.
>
> Signed-off-by: Ronald Tschalär <ronald@innovation.ch>
> Cc: Dean Jenkins <Dean_Jenkins@mentor.com>
> Cc: Lukas Wunner <lukas@wunner.de>
> Cc: Marcel Holtmann <marcel@holtmann.org>
> Cc: Gustavo Padovan <gustavo@padovan.org>
> Cc: Johan Hedberg <johan.hedberg@gmail.com>
> ---
> drivers/bluetooth/hci_ldisc.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)

patch has been applied to bluetooth-next tree.

Regards

Marcel

\
 
 \ /
  Last update: 2017-10-30 15:49    [W:0.060 / U:22.332 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site