linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gianluca Altomani <altomanigianluca@gmail.com>
To: linux-bluetooth@vger.kernel.org
Cc: Gianluca Altomani <altomanigianluca@gmail.com>
Subject: [PATCH BlueZ 0/2] Fix use-after-free in GATT client discovery
Date: Wed, 30 Sep 2026 11:39:26 +0200	[thread overview]
Message-ID: <20260930093928.360745-1-altomanigianluca@gmail.com> (raw)

bluetoothd crashes in discovery_op_complete() when a discovery of a
connected peer's GATT database is cut short, e.g. because the link
drops mid-discovery. Two separate bugs leave a freed service in the
discovery's pending_svcs queue, and each patch fixes one of them.

It reproduces by connecting over LE, reading one characteristic and
disconnecting about once a second, with a peer that answers the
remote's GATT discovery. Each connection is short enough that the
remote's discovery of the peer is still running when the link drops.
On 5.72 bluetoothd crashed on the 15th connection in 4 runs out of 4.
With both patches it survived 381 connections in a row. On 5.83, 50
such connections crashed the unpatched daemon within the first minute
and pass with both patches.

Gianluca Altomani (2):
  shared/gatt-db: Always notify service removal
  shared/gatt-client: Fix double-queued service

 src/shared/gatt-client.c | 10 ++++++++--
 src/shared/gatt-db.c     |  9 +++++++--
 2 files changed, 15 insertions(+), 4 deletions(-)

-- 
2.55.0


             reply	other threads:[~2026-09-30  9:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-30  9:39 Gianluca Altomani [this message]
2026-09-30  9:39 ` [PATCH BlueZ 1/2] shared/gatt-db: Always notify service removal Gianluca Altomani
2026-09-30 15:13   ` Fix use-after-free in GATT client discovery bluez.test.bot
2026-09-30  9:39 ` [PATCH BlueZ 2/2] shared/gatt-client: Fix double-queued service Gianluca Altomani

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=20260930093928.360745-1-altomanigianluca@gmail.com \
    --to=altomanigianluca@gmail.com \
    --cc=linux-bluetooth@vger.kernel.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).