All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ 0/4] Adjust tests for sequential conn establishing
@ 2024-01-29 11:48 Jonas Dreßler
  2024-01-29 11:48 ` [PATCH BlueZ 1/4] mgmt-tester: Add a 0-opcode to expect_hci_list lists Jonas Dreßler
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Jonas Dreßler @ 2024-01-29 11:48 UTC (permalink / raw)
  To: linux-bluetooth, Luiz Augusto von Dentz; +Cc: Jonas Dreßler

We're going to change the logic to establish connections to ACL
devices in the kernel so that they only happen sequentially,
similar to what we're already doing for "LE Create Connection".

This needs a change in mgmt-tester, and while at it, let's also
introduce a test verifying the new behavior.

Also included in this series is a small drive-by fix for running
mgmt-tester with address sanititzer.

Kernel series: https://lore.kernel.org/linux-bluetooth/20240108224614.56900-1-verdre@v0yd.nl/

Jonas Dreßler (4):
  mgmt-tester: Add a 0-opcode to expect_hci_list lists
  mgmt-tester: Adjust a test for recent kernel changes
  emulator/btdev: Send page timeout after 2 secs delay
  mgmt-tester: Add a test for connecting sequentially

 emulator/btdev.c    |  30 ++++++++++-
 tools/mgmt-tester.c | 129 +++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 157 insertions(+), 2 deletions(-)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 11+ messages in thread
* [PATCH BlueZ v2 1/4] mgmt-tester: Add a 0-entry to expect_hci_list lists
@ 2024-02-06 11:22 Jonas Dreßler
  2024-02-06 13:03 ` Adjust tests for sequential conn establishing bluez.test.bot
  0 siblings, 1 reply; 11+ messages in thread
From: Jonas Dreßler @ 2024-02-06 11:22 UTC (permalink / raw)
  To: linux-bluetooth, Luiz Augusto von Dentz; +Cc: Jonas Dreßler

In add_expect_hci_list() we iterate through the entries of the
expect_hci_list as long as there is an opcode, which means currently
this relies on overflowing the buffer to detect the end of the list.

This is not great and when running with address sanitizer, the
out-of-bounds read gets detected and mgmt-tester aborts. Fix it by
adding a trailing zero-entry to all those lists.
---
 tools/mgmt-tester.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/tools/mgmt-tester.c b/tools/mgmt-tester.c
index 7dfd1b0c7..7d884bbf6 100644
--- a/tools/mgmt-tester.c
+++ b/tools/mgmt-tester.c
@@ -8798,6 +8798,7 @@ static const struct hci_cmd_data multi_ext_adv_add_second_hci_cmds[] = {
 		.len = sizeof(le_set_ext_adv_enable_inst_2),
 		.param = le_set_ext_adv_enable_inst_2,
 	},
+	{},
 };
 
 static const struct generic_data multi_ext_advertising_add_second_2 = {
@@ -8845,6 +8846,7 @@ static const struct hci_cmd_data multi_ext_adv_remove_adv_hci_cmds[] = {
 		.len = sizeof(advertising_instance1_param),
 		.param = advertising_instance1_param,
 	},
+	{},
 };
 
 static const struct generic_data multi_ext_advertising_remove = {
@@ -8877,6 +8879,7 @@ static const struct hci_cmd_data multi_ext_adv_remove_all_adv_hci_cmds[] = {
 	{
 		.opcode = BT_HCI_CMD_LE_CLEAR_ADV_SETS,
 	},
+	{},
 };
 
 static const struct generic_data multi_ext_advertising_remove_all = {
@@ -8913,6 +8916,7 @@ static const struct hci_cmd_data multi_ext_adv_add_2_advs_hci_cmds[] = {
 		.len = sizeof(set_ext_adv_data_test1),
 		.param = set_ext_adv_data_test1,
 	},
+	{},
 };
 
 static const struct generic_data multi_ext_advertising_add_no_power = {
@@ -10378,6 +10382,7 @@ static const struct hci_cmd_data ll_privacy_add_device_3_hci_list[] = {
 		.param = set_resolv_on_param,
 		.len = sizeof(set_resolv_on_param),
 	},
+	{},
 };
 
 static const struct generic_data ll_privacy_add_device_3 = {
@@ -10495,6 +10500,7 @@ static const struct hci_cmd_data ll_privacy_add_device_9_hci_list[] = {
 		.len = sizeof(le_add_to_resolv_list_param),
 		.param = le_add_to_resolv_list_param
 	},
+	{},
 };
 
 static const struct generic_data ll_privacy_add_device_9 = {
@@ -10823,6 +10829,7 @@ static const struct hci_cmd_data ll_privacy_set_device_flags_1_hci_list[] = {
 		.param = set_resolv_on_param,
 		.len = sizeof(set_resolv_on_param),
 	},
+	{},
 };
 
 static const uint8_t device_flags_changed_params_1[] = {
-- 
2.43.0


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

end of thread, other threads:[~2024-02-06 13:03 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-29 11:48 [PATCH BlueZ 0/4] Adjust tests for sequential conn establishing Jonas Dreßler
2024-01-29 11:48 ` [PATCH BlueZ 1/4] mgmt-tester: Add a 0-opcode to expect_hci_list lists Jonas Dreßler
2024-01-29 13:40   ` Luiz Augusto von Dentz
2024-02-06 10:26     ` Jonas Dreßler
2024-01-29 13:52   ` Adjust tests for sequential conn establishing bluez.test.bot
2024-01-29 11:48 ` [PATCH BlueZ 2/4] mgmt-tester: Adjust a test for recent kernel changes Jonas Dreßler
2024-01-29 13:41   ` Luiz Augusto von Dentz
2024-01-29 11:48 ` [PATCH BlueZ 3/4] emulator/btdev: Send page timeout after 2 secs delay Jonas Dreßler
2024-01-29 13:58   ` Luiz Augusto von Dentz
2024-01-29 11:49 ` [PATCH BlueZ 4/4] mgmt-tester: Add a test for connecting sequentially Jonas Dreßler
  -- strict thread matches above, loose matches on Subject: below --
2024-02-06 11:22 [PATCH BlueZ v2 1/4] mgmt-tester: Add a 0-entry to expect_hci_list lists Jonas Dreßler
2024-02-06 13:03 ` Adjust tests for sequential conn establishing bluez.test.bot

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.