lkml.org 
[lkml]   [2019]   [Nov]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.14 212/239] Bluetooth: hci_serdev: clear HCI_UART_PROTO_READY to avoid closing proto races
    Date
    From: Balakrishna Godavarthi <bgodavar@codeaurora.org>

    [ Upstream commit 7cf7846d27bfc9731e449857db3eec5e0e9701ba ]

    Clearing HCI_UART_PROTO_READY will avoid usage of proto function pointers
    before running the proto close function pointer. There is chance of kernel
    crash, due to usage of non proto close function pointers after proto close.

    Signed-off-by: Balakrishna Godavarthi <bgodavar@codeaurora.org>
    Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    drivers/bluetooth/hci_serdev.c | 1 +
    1 file changed, 1 insertion(+)

    diff --git a/drivers/bluetooth/hci_serdev.c b/drivers/bluetooth/hci_serdev.c
    index 52e6d4d1608e3..69c00a3db5382 100644
    --- a/drivers/bluetooth/hci_serdev.c
    +++ b/drivers/bluetooth/hci_serdev.c
    @@ -360,6 +360,7 @@ void hci_uart_unregister_device(struct hci_uart *hu)
    {
    struct hci_dev *hdev = hu->hdev;

    + clear_bit(HCI_UART_PROTO_READY, &hu->flags);
    hci_unregister_dev(hdev);
    hci_free_dev(hdev);

    --
    2.20.1


    \
     
     \ /
      Last update: 2019-11-19 06:55    [W:2.736 / U:0.200 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site