linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: vhci: Fix checking of msft_opcode
@ 2021-10-21 18:44 Luiz Augusto von Dentz
  2021-10-21 19:10 ` bluez.test.bot
  2021-10-22  4:47 ` [PATCH] " Marcel Holtmann
  0 siblings, 2 replies; 5+ messages in thread
From: Luiz Augusto von Dentz @ 2021-10-21 18:44 UTC (permalink / raw)
  To: linux-bluetooth

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

msft_opcode shall be use a vendor ogf (0x3f) but the check was
swifting the bits in the wrong order due to a missing parantesis
over val & 0xffff, but since the code already checks for values over
0xffff it shall not be necessary to perform that operation it now just
removes which makes it work properly when setting opcodes like 0xfce1.

Fixes: b8f5482c9638 ("Bluetooth: vhci: Add support for setting msft_opcode and aosp_capable")
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
---
 drivers/bluetooth/hci_vhci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/bluetooth/hci_vhci.c b/drivers/bluetooth/hci_vhci.c
index 9cb7c8fafbf9..49ac884d996e 100644
--- a/drivers/bluetooth/hci_vhci.c
+++ b/drivers/bluetooth/hci_vhci.c
@@ -200,7 +200,7 @@ static int msft_opcode_set(void *data, u64 val)
 {
 	struct vhci_data *vhci = data;
 
-	if (val > 0xffff || (val & 0xffff >> 10) != 0x3f)
+	if (val > 0xffff || hci_opcode_ogf(val) != 0x3f)
 		return -EINVAL;
 
 	if (vhci->msft_opcode)
-- 
2.31.1


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

* RE: Bluetooth: vhci: Fix checking of msft_opcode
  2021-10-21 18:44 [PATCH] Bluetooth: vhci: Fix checking of msft_opcode Luiz Augusto von Dentz
@ 2021-10-21 19:10 ` bluez.test.bot
  2021-10-22  4:47 ` [PATCH] " Marcel Holtmann
  1 sibling, 0 replies; 5+ messages in thread
From: bluez.test.bot @ 2021-10-21 19:10 UTC (permalink / raw)
  To: linux-bluetooth, luiz.dentz

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

---Test result---

Test Summary:
CheckPatch                    PASS      2.05 seconds
GitLint                       FAIL      2.15 seconds
BuildKernel                   PASS      547.67 seconds
TestRunner: Setup             PASS      412.76 seconds
TestRunner: l2cap-tester      PASS      9.52 seconds
TestRunner: bnep-tester       PASS      5.16 seconds
TestRunner: mgmt-tester       PASS      44.87 seconds
TestRunner: rfcomm-tester     PASS      6.15 seconds
TestRunner: sco-tester        PASS      6.35 seconds
TestRunner: smp-tester        PASS      6.11 seconds
TestRunner: userchan-tester   PASS      5.30 seconds

Details
##############################
Test: GitLint - FAIL - 2.15 seconds
Run gitlint with rule in .gitlint
Bluetooth: vhci: Fix checking of msft_opcode
11: B1 Line exceeds max length (93>80): "Fixes: b8f5482c9638 ("Bluetooth: vhci: Add support for setting msft_opcode and aosp_capable")"




---
Regards,
Linux Bluetooth


[-- Attachment #2: l2cap-tester.log --]
[-- Type: application/octet-stream, Size: 44357 bytes --]

[-- Attachment #3: bnep-tester.log --]
[-- Type: application/octet-stream, Size: 3564 bytes --]

[-- Attachment #4: mgmt-tester.log --]
[-- Type: application/octet-stream, Size: 353167 bytes --]

[-- Attachment #5: rfcomm-tester.log --]
[-- Type: application/octet-stream, Size: 11684 bytes --]

[-- Attachment #6: sco-tester.log --]
[-- Type: application/octet-stream, Size: 13924 bytes --]

[-- Attachment #7: smp-tester.log --]
[-- Type: application/octet-stream, Size: 11830 bytes --]

[-- Attachment #8: userchan-tester.log --]
[-- Type: application/octet-stream, Size: 6372 bytes --]

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

* Re: [PATCH] Bluetooth: vhci: Fix checking of msft_opcode
  2021-10-21 18:44 [PATCH] Bluetooth: vhci: Fix checking of msft_opcode Luiz Augusto von Dentz
  2021-10-21 19:10 ` bluez.test.bot
@ 2021-10-22  4:47 ` Marcel Holtmann
  1 sibling, 0 replies; 5+ messages in thread
From: Marcel Holtmann @ 2021-10-22  4:47 UTC (permalink / raw)
  To: Luiz Augusto von Dentz; +Cc: linux-bluetooth

Hi Luiz,

> msft_opcode shall be use a vendor ogf (0x3f) but the check was
> swifting the bits in the wrong order due to a missing parantesis
> over val & 0xffff, but since the code already checks for values over
> 0xffff it shall not be necessary to perform that operation it now just
> removes which makes it work properly when setting opcodes like 0xfce1.
> 
> Fixes: b8f5482c9638 ("Bluetooth: vhci: Add support for setting msft_opcode and aosp_capable")
> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> ---
> drivers/bluetooth/hci_vhci.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)

patch has been applied to bluetooth-next tree.

Regards

Marcel


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

* Re: [PATCH] Bluetooth: vhci: Fix checking of msft_opcode
  2021-10-20 18:34 Luiz Augusto von Dentz
@ 2021-10-21 16:39 ` Marcel Holtmann
  0 siblings, 0 replies; 5+ messages in thread
From: Marcel Holtmann @ 2021-10-21 16:39 UTC (permalink / raw)
  To: Luiz Augusto von Dentz; +Cc: linux-bluetooth

Hi Luiz,

> msft_opcode shall be use a vendor ogf (0x3f) but the check was
> swifting the bits in the wrong order due to a missing parantesis
> over val & 0xffff, but since the code already checks for values over
> 0xffff it shall not be necessary to perform that operation it now just
> removes which makes it work properly when setting opcodes like 0xfce1.

please add Fixes: tag here.

> 
> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> ---
> drivers/bluetooth/hci_vhci.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/bluetooth/hci_vhci.c b/drivers/bluetooth/hci_vhci.c
> index 9cb7c8fafbf9..0eb90e7c3c82 100644
> --- a/drivers/bluetooth/hci_vhci.c
> +++ b/drivers/bluetooth/hci_vhci.c
> @@ -200,7 +200,7 @@ static int msft_opcode_set(void *data, u64 val)
> {
> 	struct vhci_data *vhci = data;
> 
> -	if (val > 0xffff || (val & 0xffff >> 10) != 0x3f)
> +	if (val > 0xffff || (val >> 10) != 0x3f)

Then lets use hci_opcode_ogf(val) != 0x3f.

Regards

Marcel


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

* [PATCH] Bluetooth: vhci: Fix checking of msft_opcode
@ 2021-10-20 18:34 Luiz Augusto von Dentz
  2021-10-21 16:39 ` Marcel Holtmann
  0 siblings, 1 reply; 5+ messages in thread
From: Luiz Augusto von Dentz @ 2021-10-20 18:34 UTC (permalink / raw)
  To: linux-bluetooth

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

msft_opcode shall be use a vendor ogf (0x3f) but the check was
swifting the bits in the wrong order due to a missing parantesis
over val & 0xffff, but since the code already checks for values over
0xffff it shall not be necessary to perform that operation it now just
removes which makes it work properly when setting opcodes like 0xfce1.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
---
 drivers/bluetooth/hci_vhci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/bluetooth/hci_vhci.c b/drivers/bluetooth/hci_vhci.c
index 9cb7c8fafbf9..0eb90e7c3c82 100644
--- a/drivers/bluetooth/hci_vhci.c
+++ b/drivers/bluetooth/hci_vhci.c
@@ -200,7 +200,7 @@ static int msft_opcode_set(void *data, u64 val)
 {
 	struct vhci_data *vhci = data;
 
-	if (val > 0xffff || (val & 0xffff >> 10) != 0x3f)
+	if (val > 0xffff || (val >> 10) != 0x3f)
 		return -EINVAL;
 
 	if (vhci->msft_opcode)
-- 
2.31.1


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

end of thread, other threads:[~2021-10-22  4:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-21 18:44 [PATCH] Bluetooth: vhci: Fix checking of msft_opcode Luiz Augusto von Dentz
2021-10-21 19:10 ` bluez.test.bot
2021-10-22  4:47 ` [PATCH] " Marcel Holtmann
  -- strict thread matches above, loose matches on Subject: below --
2021-10-20 18:34 Luiz Augusto von Dentz
2021-10-21 16:39 ` Marcel Holtmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).