From: Enjan Chou <zhouer@gmail.com>
To: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: Bluetooth: hci_conn: Don't leak hci_conn when dequeuing its create command
Date: Tue, 1 Dec 2026 01:57:39 -0500 [thread overview]
Message-ID: <20261201065740.1187692-1-zhouer@gmail.com> (raw)
In-Reply-To: <CABBYNZ+f3jbUS8zy_702Qf4LrHAYTREBmZ5MRsFYhQ7K=nO=7Q@mail.gmail.com>
Hi Luiz,
On Mon, Nov 30, 2026, Luiz Augusto von Dentz wrote:
> Netdev sashiko found a problem with these changes:
>
> https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261126234701.215190-1-zhouer%40gmail.com
Sashiko is right, thanks. I had only looked at advertising reports
queuing the create command again, and missed a connect() that reuses
the hci_conn while hci_conn_timeout() is aborting it.
I reproduced it for both ACL and LE with an emulated controller and a
sleep added to widen the window. In v2, which I will send separately,
hci_acl_create_conn_sync() and hci_le_create_conn_sync() return
-ECANCELED when abort_reason is set, and it no longer happens.
Checking abort_reason in hci_connect_le() and hci_connect_acl() instead
would not be enough: hci_conn_timeout() does not hold hdev->lock, so
abort_reason can still be set right after the check.
Regards,
Enjan
prev parent reply other threads:[~2026-12-01 6:57 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-26 23:47 [PATCH] Bluetooth: hci_conn: Don't leak hci_conn when dequeuing its create command Enjan Chou
2026-11-27 4:24 ` bluez.test.bot
2026-11-30 17:47 ` Luiz Augusto von Dentz
2026-12-01 6:57 ` Enjan Chou [this message]
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=20261201065740.1187692-1-zhouer@gmail.com \
--to=zhouer@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=luiz.dentz@gmail.com \
/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