* [PATCH] Bluetooth: Enforce validation on max value of connection interval
@ 2024-01-25 6:50 Kai-Heng Feng
2024-01-25 7:32 ` bluez.test.bot
2024-01-25 20:50 ` [PATCH] " patchwork-bot+bluetooth
0 siblings, 2 replies; 3+ messages in thread
From: Kai-Heng Feng @ 2024-01-25 6:50 UTC (permalink / raw)
To: marcel, johan.hedberg, luiz.dentz
Cc: Kai-Heng Feng, linux-bluetooth, linux-kernel
Right now Linux BT stack cannot pass test case "GAP/CONN/CPUP/BV-05-C
'Connection Parameter Update Procedure Invalid Parameters Central
Responder'" in Bluetooth Test Suite revision GAP.TS.p44. [0]
That was revoled by commit c49a8682fc5d ("Bluetooth: validate BLE
connection interval updates"), but later got reverted due to devices
like keyboards and mice may require low connection interval.
So only validate the max value connection interval to pass the Test
Suite, and let devices to request low connection interval if needed.
[0] https://www.bluetooth.org/docman/handlers/DownloadDoc.ashx?doc_id=229869
Fixes: 68d19d7d9957 ("Revert "Bluetooth: validate BLE connection interval updates"")
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
---
net/bluetooth/hci_event.c | 4 ++++
net/bluetooth/l2cap_core.c | 8 +++++++-
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index ef8c3bed7361..0ed3388368f9 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -6794,6 +6794,10 @@ static void hci_le_remote_conn_param_req_evt(struct hci_dev *hdev, void *data,
return send_conn_param_neg_reply(hdev, handle,
HCI_ERROR_UNKNOWN_CONN_ID);
+ if (max > hcon->le_conn_max_interval)
+ return send_conn_param_neg_reply(hdev, handle,
+ HCI_ERROR_INVALID_LL_PARAMS);
+
if (hci_check_conn_params(min, max, latency, timeout))
return send_conn_param_neg_reply(hdev, handle,
HCI_ERROR_INVALID_LL_PARAMS);
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index 60298975d5c4..656f49b299d2 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -5613,7 +5613,13 @@ static inline int l2cap_conn_param_update_req(struct l2cap_conn *conn,
memset(&rsp, 0, sizeof(rsp));
- err = hci_check_conn_params(min, max, latency, to_multiplier);
+ if (max > hcon->le_conn_max_interval) {
+ BT_DBG("requested connection interval exceeds current bounds.");
+ err = -EINVAL;
+ } else {
+ err = hci_check_conn_params(min, max, latency, to_multiplier);
+ }
+
if (err)
rsp.result = cpu_to_le16(L2CAP_CONN_PARAM_REJECTED);
else
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* RE: Bluetooth: Enforce validation on max value of connection interval
2024-01-25 6:50 [PATCH] Bluetooth: Enforce validation on max value of connection interval Kai-Heng Feng
@ 2024-01-25 7:32 ` bluez.test.bot
2024-01-25 20:50 ` [PATCH] " patchwork-bot+bluetooth
1 sibling, 0 replies; 3+ messages in thread
From: bluez.test.bot @ 2024-01-25 7:32 UTC (permalink / raw)
To: linux-bluetooth, kai.heng.feng
[-- Attachment #1: Type: text/plain, Size: 2608 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=819736
---Test result---
Test Summary:
CheckPatch FAIL 1.07 seconds
GitLint PASS 0.31 seconds
SubjectPrefix PASS 0.12 seconds
BuildKernel PASS 28.05 seconds
CheckAllWarning PASS 30.91 seconds
CheckSparse WARNING 36.43 seconds
CheckSmatch WARNING 100.01 seconds
BuildKernel32 PASS 27.22 seconds
TestRunnerSetup PASS 435.23 seconds
TestRunner_l2cap-tester PASS 23.18 seconds
TestRunner_iso-tester PASS 42.96 seconds
TestRunner_bnep-tester PASS 6.84 seconds
TestRunner_mgmt-tester PASS 152.18 seconds
TestRunner_rfcomm-tester PASS 10.86 seconds
TestRunner_sco-tester PASS 14.45 seconds
TestRunner_ioctl-tester PASS 12.15 seconds
TestRunner_mesh-tester PASS 8.84 seconds
TestRunner_smp-tester PASS 9.76 seconds
TestRunner_userchan-tester PASS 7.20 seconds
IncrementalBuild PASS 26.48 seconds
Details
##############################
Test: CheckPatch - FAIL
Desc: Run checkpatch.pl script
Output:
Bluetooth: Enforce validation on max value of connection interval
WARNING: Prefer a maximum 75 chars per line (possible unwrapped commit description?)
#82:
[0] https://www.bluetooth.org/docman/handlers/DownloadDoc.ashx?doc_id=229869
total: 0 errors, 1 warnings, 0 checks, 24 lines checked
NOTE: For some of the reported defects, checkpatch may be able to
mechanically convert to the typical style using --fix or --fix-inplace.
/github/workspace/src/src/13530147.patch has style problems, please review.
NOTE: Ignored message types: UNKNOWN_COMMIT_ID
NOTE: If any of the errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.
##############################
Test: CheckSparse - WARNING
Desc: Run sparse tool with linux kernel
Output:
net/bluetooth/hci_event.c: note: in included file (through include/net/bluetooth/hci_core.h):
##############################
Test: CheckSmatch - WARNING
Desc: Run smatch tool with source
Output:
net/bluetooth/hci_event.c: note: in included file (through include/net/bluetooth/hci_core.h):
---
Regards,
Linux Bluetooth
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Bluetooth: Enforce validation on max value of connection interval
2024-01-25 6:50 [PATCH] Bluetooth: Enforce validation on max value of connection interval Kai-Heng Feng
2024-01-25 7:32 ` bluez.test.bot
@ 2024-01-25 20:50 ` patchwork-bot+bluetooth
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+bluetooth @ 2024-01-25 20:50 UTC (permalink / raw)
To: Kai-Heng Feng
Cc: marcel, johan.hedberg, luiz.dentz, linux-bluetooth, linux-kernel
Hello:
This patch was applied to bluetooth/bluetooth-next.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:
On Thu, 25 Jan 2024 14:50:28 +0800 you wrote:
> Right now Linux BT stack cannot pass test case "GAP/CONN/CPUP/BV-05-C
> 'Connection Parameter Update Procedure Invalid Parameters Central
> Responder'" in Bluetooth Test Suite revision GAP.TS.p44. [0]
>
> That was revoled by commit c49a8682fc5d ("Bluetooth: validate BLE
> connection interval updates"), but later got reverted due to devices
> like keyboards and mice may require low connection interval.
>
> [...]
Here is the summary with links:
- Bluetooth: Enforce validation on max value of connection interval
https://git.kernel.org/bluetooth/bluetooth-next/c/9434e62334d5
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] 3+ messages in thread
end of thread, other threads:[~2024-01-25 20:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-25 6:50 [PATCH] Bluetooth: Enforce validation on max value of connection interval Kai-Heng Feng
2024-01-25 7:32 ` bluez.test.bot
2024-01-25 20:50 ` [PATCH] " patchwork-bot+bluetooth
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).