All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ v2 1/4] shared/bap: Remove broadcast sink PACs in bt_bap_remove_pac()
@ 2026-11-22 19:33 Simon Mikuda
  2026-11-22 19:33 ` [PATCH BlueZ v2 2/4] unit/test-bap: Check that a broadcast sink PAC can be removed Simon Mikuda
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Simon Mikuda @ 2026-11-22 19:33 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Simon Mikuda

bt_bap_remove_pac() looked for the PAC in the sink, source and broadcast
source lists only, so a broadcast sink PAC stayed in broadcast_sinks
after its endpoint was freed. When the endpoint owner goes away, like
WirePlumber restarting, the next BIGInfo matches the stale PAC and
bluetoothd crashes:

  pac_bcast_config (endpoint=<freed>) at profiles/audio/media.c
  pac_config () at profiles/audio/media.c
  bap_bcast_config () at src/shared/bap.c
  bt_bap_stream_config () at src/shared/bap.c
  create_stream_for_bis () at profiles/audio/bap.c
  bis_handler () at profiles/audio/bap.c
  bt_bap_parse_base () at src/shared/bap.c
  big_info_report_cb () at profiles/audio/bap.c

Fixes: d49ea14f70da ("shared/bap: Add support for BAP broadcast sink")
Assisted-by: Claude:claude-opus-5-5
---
 src/shared/bap.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/shared/bap.c b/src/shared/bap.c
index 8fc28de52..9404bddba 100644
--- a/src/shared/bap.c
+++ b/src/shared/bap.c
@@ -4864,6 +4864,9 @@ bool bt_bap_remove_pac(struct bt_bap_pac *pac)
 	if (queue_remove_if(pac->bdb->broadcast_sources, NULL, pac))
 		goto found;
 
+	if (queue_remove_if(pac->bdb->broadcast_sinks, NULL, pac))
+		goto found;
+
 	return false;
 
 found:

base-commit: 1adfe662efeff12997df9ddd0960dbd0de9c8ea7
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-11-23 15:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-22 19:33 [PATCH BlueZ v2 1/4] shared/bap: Remove broadcast sink PACs in bt_bap_remove_pac() Simon Mikuda
2026-11-22 19:33 ` [PATCH BlueZ v2 2/4] unit/test-bap: Check that a broadcast sink PAC can be removed Simon Mikuda
2026-11-22 19:33 ` [PATCH BlueZ v2 3/4] bap: Don't leak the io of a PA sync that failed Simon Mikuda
2026-11-22 19:33 ` [PATCH BlueZ v2 4/4] bap: Close a pending PA or BIG sync when a sink session ends Simon Mikuda
2026-11-22 23:40 ` [BlueZ,v2,1/4] shared/bap: Remove broadcast sink PACs in bt_bap_remove_pac() bluez.test.bot
2026-11-23 15:01   ` Luiz Augusto von Dentz

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.