All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ 1/2] client/player: Fix crashes accessing metadata
@ 2023-05-11  0:01 Luiz Augusto von Dentz
  2023-05-11  0:01 ` [PATCH BlueZ 2/2] shared/bap: Fix not sending ASE Receiver Stop Ready Luiz Augusto von Dentz
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Luiz Augusto von Dentz @ 2023-05-11  0:01 UTC (permalink / raw)
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

If metadata is not set the respective iovec is left NULL so it needs to
be checked before accessing its fields.
---
 client/player.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/client/player.c b/client/player.c
index f055ff941569..091d7005f42a 100644
--- a/client/player.c
+++ b/client/player.c
@@ -1743,7 +1743,7 @@ static void append_properties(DBusMessageIter *iter,
 					DBUS_TYPE_BYTE, &cfg->caps->iov_base,
 					cfg->caps->iov_len);
 
-	if (cfg->meta->iov_len) {
+	if (cfg->meta && cfg->meta->iov_len) {
 		g_dbus_dict_append_basic_array(&dict, DBUS_TYPE_STRING, &meta,
 				DBUS_TYPE_BYTE, &cfg->meta->iov_base,
 				cfg->meta->iov_len);
@@ -1850,7 +1850,8 @@ static DBusMessage *endpoint_select_properties_reply(struct endpoint *ep,
 	cfg->target_latency = preset->target_latency;
 
 	/* Copy metadata */
-	iov_append(&cfg->meta, cfg->ep->meta->iov_base, cfg->ep->meta->iov_len);
+	if (ep->meta)
+		iov_append(&cfg->meta, ep->meta->iov_base, ep->meta->iov_len);
 
 	if (preset->qos.phy)
 		/* Set QoS parameters */
-- 
2.40.0


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

* [PATCH BlueZ 2/2] shared/bap: Fix not sending ASE Receiver Stop Ready
  2023-05-11  0:01 [PATCH BlueZ 1/2] client/player: Fix crashes accessing metadata Luiz Augusto von Dentz
@ 2023-05-11  0:01 ` Luiz Augusto von Dentz
  2023-05-11  2:21 ` [BlueZ,1/2] client/player: Fix crashes accessing metadata bluez.test.bot
  2023-05-12 20:40 ` [PATCH BlueZ 1/2] " patchwork-bot+bluetooth
  2 siblings, 0 replies; 4+ messages in thread
From: Luiz Augusto von Dentz @ 2023-05-11  0:01 UTC (permalink / raw)
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

This fixes not sending ASE Receiver Stop Ready if stream is on disabling
state when CIS is disconnected.

Fixes: https://github.com/bluez/bluez/issues/516
---
 src/shared/bap.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/src/shared/bap.c b/src/shared/bap.c
index 6131c312865a..f194f466fde1 100644
--- a/src/shared/bap.c
+++ b/src/shared/bap.c
@@ -1115,6 +1115,18 @@ static bool match_stream_io(const void *data, const void *user_data)
 	return stream->io == io;
 }
 
+static void stream_stop_disabling(void *data, void *user_data)
+{
+	struct bt_bap_stream *stream = data;
+
+	if (stream->io || stream->ep->state != BT_ASCS_ASE_STATE_DISABLING)
+		return;
+
+	DBG(stream->bap, "stream %p", stream);
+
+	bt_bap_stream_stop(stream, NULL, NULL);
+}
+
 static bool bap_stream_io_detach(struct bt_bap_stream *stream)
 {
 	struct bt_bap_stream *link;
@@ -1133,6 +1145,9 @@ static bool bap_stream_io_detach(struct bt_bap_stream *stream)
 		/* Detach link if in QoS state */
 		if (link->ep->state == BT_ASCS_ASE_STATE_QOS)
 			bap_stream_io_detach(link);
+	} else {
+		/* Links without IO on disabling state shall be stopped. */
+		queue_foreach(stream->links, stream_stop_disabling, NULL);
 	}
 
 	stream_io_unref(io);
-- 
2.40.0


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

* RE: [BlueZ,1/2] client/player: Fix crashes accessing metadata
  2023-05-11  0:01 [PATCH BlueZ 1/2] client/player: Fix crashes accessing metadata Luiz Augusto von Dentz
  2023-05-11  0:01 ` [PATCH BlueZ 2/2] shared/bap: Fix not sending ASE Receiver Stop Ready Luiz Augusto von Dentz
@ 2023-05-11  2:21 ` bluez.test.bot
  2023-05-12 20:40 ` [PATCH BlueZ 1/2] " patchwork-bot+bluetooth
  2 siblings, 0 replies; 4+ messages in thread
From: bluez.test.bot @ 2023-05-11  2:21 UTC (permalink / raw)
  To: linux-bluetooth, luiz.dentz

[-- Attachment #1: Type: text/plain, Size: 949 bytes --]

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=746595

---Test result---

Test Summary:
CheckPatch                    PASS      1.05 seconds
GitLint                       PASS      0.71 seconds
BuildEll                      PASS      26.91 seconds
BluezMake                     PASS      1003.92 seconds
MakeCheck                     PASS      12.50 seconds
MakeDistcheck                 PASS      155.98 seconds
CheckValgrind                 PASS      252.51 seconds
CheckSmatch                   PASS      338.80 seconds
bluezmakeextell               PASS      102.02 seconds
IncrementalBuild              PASS      1716.07 seconds
ScanBuild                     PASS      1049.43 seconds



---
Regards,
Linux Bluetooth


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

* Re: [PATCH BlueZ 1/2] client/player: Fix crashes accessing metadata
  2023-05-11  0:01 [PATCH BlueZ 1/2] client/player: Fix crashes accessing metadata Luiz Augusto von Dentz
  2023-05-11  0:01 ` [PATCH BlueZ 2/2] shared/bap: Fix not sending ASE Receiver Stop Ready Luiz Augusto von Dentz
  2023-05-11  2:21 ` [BlueZ,1/2] client/player: Fix crashes accessing metadata bluez.test.bot
@ 2023-05-12 20:40 ` patchwork-bot+bluetooth
  2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+bluetooth @ 2023-05-12 20:40 UTC (permalink / raw)
  To: Luiz Augusto von Dentz; +Cc: linux-bluetooth

Hello:

This series was applied to bluetooth/bluez.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:

On Wed, 10 May 2023 17:01:54 -0700 you wrote:
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> 
> If metadata is not set the respective iovec is left NULL so it needs to
> be checked before accessing its fields.
> ---
>  client/player.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)

Here is the summary with links:
  - [BlueZ,1/2] client/player: Fix crashes accessing metadata
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=67fd8479f11c
  - [BlueZ,2/2] shared/bap: Fix not sending ASE Receiver Stop Ready
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=24b4ba1a3936

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2023-05-12 20:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-11  0:01 [PATCH BlueZ 1/2] client/player: Fix crashes accessing metadata Luiz Augusto von Dentz
2023-05-11  0:01 ` [PATCH BlueZ 2/2] shared/bap: Fix not sending ASE Receiver Stop Ready Luiz Augusto von Dentz
2023-05-11  2:21 ` [BlueZ,1/2] client/player: Fix crashes accessing metadata bluez.test.bot
2023-05-12 20:40 ` [PATCH BlueZ 1/2] " patchwork-bot+bluetooth

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.