All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: mgmt: Fix TLV parameter code type conversion
@ 2025-12-18 12:08 Stefan Sørensen
  2025-12-18 12:41 ` Paul Menzel
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Stefan Sørensen @ 2025-12-18 12:08 UTC (permalink / raw)
  To: marcel, johan.hedberg, luiz.dentz, linux-bluetooth; +Cc: Stefan Sørensen

Use the correct le16 conversion for the TLV type field when adding a
TLV using a u32 data field.

Fixes: afa20d8099ddf ("Bluetooth: mgmt: Add idle_timeout to configurable system parameters")
Signed-off-by: Stefan Sørensen <ssorensen@roku.com>
---
 net/bluetooth/mgmt_config.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/bluetooth/mgmt_config.c b/net/bluetooth/mgmt_config.c
index 4ec6c008cb7e6..fdcc752c6f13f 100644
--- a/net/bluetooth/mgmt_config.c
+++ b/net/bluetooth/mgmt_config.c
@@ -37,7 +37,7 @@
 
 #define TLV_SET_U32(_param_code_, _param_name_) \
 	{ \
-		{ cpu_to_le32(_param_code_), sizeof(__u32) }, \
+		{ cpu_to_le16(_param_code_), sizeof(__u32) }, \
 		cpu_to_le32(hdev->_param_name_) \
 	}
 
-- 
2.52.0


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

* Re: [PATCH] Bluetooth: mgmt: Fix TLV parameter code type conversion
  2025-12-18 12:08 [PATCH] Bluetooth: mgmt: Fix TLV parameter code type conversion Stefan Sørensen
@ 2025-12-18 12:41 ` Paul Menzel
  2025-12-18 13:00   ` [EXTERNAL] " Stefan Sørensen
  2025-12-18 12:52 ` bluez.test.bot
  2025-12-18 14:18 ` [PATCH] " Luiz Augusto von Dentz
  2 siblings, 1 reply; 5+ messages in thread
From: Paul Menzel @ 2025-12-18 12:41 UTC (permalink / raw)
  To: Stefan Sørensen; +Cc: marcel, johan.hedberg, luiz.dentz, linux-bluetooth

Dear Stefan,


Am 18.12.25 um 13:08 schrieb Stefan Sørensen:
> Use the correct le16 conversion for the TLV type field when adding a
> TLV using a u32 data field.

Why is the correct conversion?

> Fixes: afa20d8099ddf ("Bluetooth: mgmt: Add idle_timeout to configurable system parameters")
> Signed-off-by: Stefan Sørensen <ssorensen@roku.com>
> ---
>   net/bluetooth/mgmt_config.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/bluetooth/mgmt_config.c b/net/bluetooth/mgmt_config.c
> index 4ec6c008cb7e6..fdcc752c6f13f 100644
> --- a/net/bluetooth/mgmt_config.c
> +++ b/net/bluetooth/mgmt_config.c
> @@ -37,7 +37,7 @@
>   
>   #define TLV_SET_U32(_param_code_, _param_name_) \
>   	{ \
> -		{ cpu_to_le32(_param_code_), sizeof(__u32) }, \
> +		{ cpu_to_le16(_param_code_), sizeof(__u32) }, \
>   		cpu_to_le32(hdev->_param_name_) \
>   	}
>   


Kind regards,

Paul

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

* RE: Bluetooth: mgmt: Fix TLV parameter code type conversion
  2025-12-18 12:08 [PATCH] Bluetooth: mgmt: Fix TLV parameter code type conversion Stefan Sørensen
  2025-12-18 12:41 ` Paul Menzel
@ 2025-12-18 12:52 ` bluez.test.bot
  2025-12-18 14:18 ` [PATCH] " Luiz Augusto von Dentz
  2 siblings, 0 replies; 5+ messages in thread
From: bluez.test.bot @ 2025-12-18 12:52 UTC (permalink / raw)
  To: linux-bluetooth, ssorensen

[-- Attachment #1: Type: text/plain, Size: 2748 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=1034566

---Test result---

Test Summary:
CheckPatch                    PENDING   0.48 seconds
GitLint                       PENDING   0.33 seconds
SubjectPrefix                 PASS      0.07 seconds
BuildKernel                   PASS      24.46 seconds
CheckAllWarning               PASS      26.47 seconds
CheckSparse                   PASS      29.47 seconds
BuildKernel32                 PASS      23.83 seconds
TestRunnerSetup               PASS      513.51 seconds
TestRunner_l2cap-tester       PASS      25.90 seconds
TestRunner_iso-tester         PASS      65.80 seconds
TestRunner_bnep-tester        PASS      6.32 seconds
TestRunner_mgmt-tester        FAIL      128.17 seconds
TestRunner_rfcomm-tester      PASS      9.56 seconds
TestRunner_sco-tester         FAIL      16.69 seconds
TestRunner_ioctl-tester       PASS      10.17 seconds
TestRunner_mesh-tester        FAIL      11.60 seconds
TestRunner_smp-tester         PASS      9.02 seconds
TestRunner_userchan-tester    PASS      6.65 seconds
IncrementalBuild              PENDING   1.00 seconds

Details
##############################
Test: CheckPatch - PENDING
Desc: Run checkpatch.pl script
Output:

##############################
Test: GitLint - PENDING
Desc: Run gitlint
Output:

##############################
Test: TestRunner_mgmt-tester - FAIL
Desc: Run mgmt-tester with test-runner
Output:
Total: 494, Passed: 488 (98.8%), Failed: 2, Not Run: 4

Failed Test Cases
Read Exp Feature - Success                           Failed       0.104 seconds
LL Privacy - Set Flags 2 (Enable RL)                 Failed       0.149 seconds
##############################
Test: TestRunner_sco-tester - FAIL
Desc: Run sco-tester with test-runner
Output:
WARNING: possible circular locking dependency detected
BUG: sleeping function called from invalid context at net/core/sock.c:3782
BUG: sleeping function called from invalid context at net/core/sock.c:3782
Total: 30, Passed: 30 (100.0%), Failed: 0, Not Run: 0
##############################
Test: TestRunner_mesh-tester - FAIL
Desc: Run mesh-tester with test-runner
Output:
Total: 10, Passed: 8 (80.0%), Failed: 2, Not Run: 0

Failed Test Cases
Mesh - Send cancel - 1                               Timed out    1.844 seconds
Mesh - Send cancel - 2                               Timed out    1.998 seconds
##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series
Output:



---
Regards,
Linux Bluetooth


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

* Re: [EXTERNAL] Re: [PATCH] Bluetooth: mgmt: Fix TLV parameter code type conversion
  2025-12-18 12:41 ` Paul Menzel
@ 2025-12-18 13:00   ` Stefan Sørensen
  0 siblings, 0 replies; 5+ messages in thread
From: Stefan Sørensen @ 2025-12-18 13:00 UTC (permalink / raw)
  To: Paul Menzel
  Cc: marcel@holtmann.org, johan.hedberg@gmail.com,
	luiz.dentz@gmail.com, linux-bluetooth@vger.kernel.org

>> Use the correct le16 conversion for the TLV type field when adding a
>> TLV using a u32 data field.
>
>Why is the correct conversion?

This is the TLV element structure:

struct mgmt_tlv {
	/* New members MUST be added within the __struct_group() macro below. */
	__struct_group(mgmt_tlv_hdr, __hdr, __packed,
		__le16 type;
		__u8   length;
	);
	__u8   value[];
} __packed;

Regards,
Stefan

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

* Re: [PATCH] Bluetooth: mgmt: Fix TLV parameter code type conversion
  2025-12-18 12:08 [PATCH] Bluetooth: mgmt: Fix TLV parameter code type conversion Stefan Sørensen
  2025-12-18 12:41 ` Paul Menzel
  2025-12-18 12:52 ` bluez.test.bot
@ 2025-12-18 14:18 ` Luiz Augusto von Dentz
  2 siblings, 0 replies; 5+ messages in thread
From: Luiz Augusto von Dentz @ 2025-12-18 14:18 UTC (permalink / raw)
  To: Stefan Sørensen; +Cc: marcel, johan.hedberg, linux-bluetooth

Hi Stefan,

On Thu, Dec 18, 2025 at 7:09 AM Stefan Sørensen <ssorensen@roku.com> wrote:
>
> Use the correct le16 conversion for the TLV type field when adding a
> TLV using a u32 data field.
>
> Fixes: afa20d8099ddf ("Bluetooth: mgmt: Add idle_timeout to configurable system parameters")
> Signed-off-by: Stefan Sørensen <ssorensen@roku.com>
> ---
>  net/bluetooth/mgmt_config.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/bluetooth/mgmt_config.c b/net/bluetooth/mgmt_config.c
> index 4ec6c008cb7e6..fdcc752c6f13f 100644
> --- a/net/bluetooth/mgmt_config.c
> +++ b/net/bluetooth/mgmt_config.c
> @@ -37,7 +37,7 @@
>
>  #define TLV_SET_U32(_param_code_, _param_name_) \
>         { \
> -               { cpu_to_le32(_param_code_), sizeof(__u32) }, \
> +               { cpu_to_le16(_param_code_), sizeof(__u32) }, \
>                 cpu_to_le32(hdev->_param_name_) \
>         }
>
> --
> 2.52.0

Ive fixed up it in place, that said I realized that these macros are
sort of not really helping in my opinion, so we might as well do
something similar to eir_append_data and not use a stack variable
since we might want to exclude the bearer specific configuration if it
is disabled. And the double parsing on set_def_system_config is also
suboptimal, anyway this is nothing you introduced it was just left out
sort of incomplete.

-- 
Luiz Augusto von Dentz

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

end of thread, other threads:[~2025-12-18 14:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-18 12:08 [PATCH] Bluetooth: mgmt: Fix TLV parameter code type conversion Stefan Sørensen
2025-12-18 12:41 ` Paul Menzel
2025-12-18 13:00   ` [EXTERNAL] " Stefan Sørensen
2025-12-18 12:52 ` bluez.test.bot
2025-12-18 14:18 ` [PATCH] " 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.