From: fdanis-oss <noreply@github.com>
To: linux-bluetooth@vger.kernel.org
Subject: [bluez/bluez] 85f3cd: shared/bap: Fix use-after-free in bt_bap_detach
Date: Mon, 31 Aug 2026 08:04:36 -0700 [thread overview]
Message-ID: <bluez/bluez/push/refs/heads/1154582/000000-85f3cd@github.com> (raw)
Branch: refs/heads/1154582
Home: https://github.com/bluez/bluez
Commit: 85f3cda412302a1454580994f5529c0dcb2d5dc5
https://github.com/bluez/bluez/commit/85f3cda412302a1454580994f5529c0dcb2d5dc5
Author: Frédéric Danis <frederic.danis@collabora.com>
Date: 2026-08-31 (Mon, 31 Aug 2026)
Changed paths:
M src/shared/bap.c
Log Message:
-----------
shared/bap: Fix use-after-free in bt_bap_detach
bt_bap_detach() invoked the pending request's completion callback via
bap_req_detach(bap->req) before clearing bap->req. Since the completion
callback (req->func) can trigger synchronous cleanup that re-enters
bt_bap_stream_cancel() for the same stream, and bt_bap_stream_cancel()
frees bap->req whenever it still matches the request being canceled,
the request could be freed while bap_req_complete() was still executing
on it, causing bap_req_complete() to dereference the now-freed request
once the callback returned.
Clear bap->req before invoking the completion callback, matching the
pattern already used by bap_abort_stream_req(), the ASE IDLE state
handler and bap_cp_notify(), so a reentrant cancel no longer finds a
stale bap->req to free.
Assisted-by: Claude:claude-sonnet-5
To unsubscribe from these emails, change your notification settings at https://github.com/bluez/bluez/settings/notifications
reply other threads:[~2026-08-31 15:04 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=bluez/bluez/push/refs/heads/1154582/000000-85f3cd@github.com \
--to=noreply@github.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.