From: Boris Brezillon <boris.brezillon@free-electrons.com>
To: Marcel Holtmann <marcel@holtmann.org>,
Gustavo Padovan <gustavo@padovan.org>,
Johan Hedberg <johan.hedberg@gmail.com>,
linux-bluetooth@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, jason.abele@gmail.com
Subject: Re: [PATCH 0/4] Bluetooth: hci_uart: various fixes
Date: Tue, 30 Aug 2016 15:26:43 +0200 [thread overview]
Message-ID: <20160830152643.3a64de8b@bbrezillon> (raw)
In-Reply-To: <1471592327-14133-1-git-send-email-boris.brezillon@free-electrons.com>
On Fri, 19 Aug 2016 09:38:43 +0200
Boris Brezillon <boris.brezillon@free-electrons.com> wrote:
> Hi,
>
> We recently faced some problems when using an BT uart chip interfaced
> through the H5 proto (rtk_h5). Here are the logs of the 2 different
> issues we had when closing the line discipline (actually, restoring
> the previous one) [1][2]. I know the kernel is Tainted in those logs,
> but after some investigations I found a few potential issues that might
> explain what we're seeing.
>
> Patches 1 and 2 are fixing 2 potential 'use after free' bugs: in some
> (unlikely) cases the timer and work we try to cancel in the closing
> path can be re-scheduled in our back, and since we're releasing the
> memory region assigned to those elements at the end of the closing
> procedure we can end-up with those invalid pointer exception when the
> work or timer handler is called.
>
> Note that this problem is pretty hard to reproduce, so I'm not sure
> my patches are fixing all the racy paths.
>
> Patches 3 and 4 are fixing potential issues that I didn't directly
> face but may be worth fixing. Path 3 is fixing a potential double
> free issue (proto->close() called twice if the hdev registration
> failed). Patch 4 is making sure we don't loose some TX events.
>
> Let me know what you think.
Ping.
>
> Thanks,
>
> Boris
>
> [1]http://code.bulix.org/8qtjly-105082
> [2]http://code.bulix.org/qzur9n-105083
>
>
> Boris Brezillon (4):
> Bluetooth: hci_ldisc: fix a race in the hdev closing path
> Bluetooth: hci_h5: fix a race in the closing path
> Bluetooth: hci_ldisc: don't release resources in hci_uart_init_work()
> Bluetooth: hci_ldisc: make sure we don't loose HCI_UART_TX_WAKEUP
> events
>
> drivers/bluetooth/hci_h5.c | 7 ++++++-
> drivers/bluetooth/hci_ldisc.c | 30 ++++++++++++++++++++++++++----
> drivers/bluetooth/hci_uart.h | 1 +
> 3 files changed, 33 insertions(+), 5 deletions(-)
>
next prev parent reply other threads:[~2016-08-30 13:26 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-19 7:38 [PATCH 0/4] Bluetooth: hci_uart: various fixes Boris Brezillon
2016-08-19 7:38 ` [PATCH 1/4] Bluetooth: hci_ldisc: fix a race in the hdev closing path Boris Brezillon
2016-08-30 16:53 ` Marcel Holtmann
2016-08-30 17:08 ` Boris Brezillon
2016-08-19 7:38 ` [PATCH 2/4] Bluetooth: hci_h5: fix a race in the " Boris Brezillon
2016-08-30 16:54 ` Marcel Holtmann
2016-08-19 7:38 ` [PATCH 3/4] Bluetooth: hci_ldisc: don't release resources in hci_uart_init_work() Boris Brezillon
2016-08-19 7:38 ` [PATCH 4/4] Bluetooth: hci_ldisc: make sure we don't loose HCI_UART_TX_WAKEUP events Boris Brezillon
2016-08-30 16:53 ` Marcel Holtmann
2016-08-30 17:10 ` Boris Brezillon
2016-08-30 13:26 ` Boris Brezillon [this message]
2016-08-30 16:48 ` [PATCH 0/4] Bluetooth: hci_uart: various fixes Marcel Holtmann
2016-08-30 17:22 ` Boris Brezillon
2016-08-31 2:08 ` Marcel Holtmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160830152643.3a64de8b@bbrezillon \
--to=boris.brezillon@free-electrons.com \
--cc=gustavo@padovan.org \
--cc=jason.abele@gmail.com \
--cc=johan.hedberg@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marcel@holtmann.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).