Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PW_SID:918106] [v1] Bluetooth: hci_sync: Fix disconnect complete event timeout issue #2622

Open
wants to merge 1 commit into
base: workflow
Choose a base branch
from

Conversation

BluezTestBot
Copy link
Owner

Sometimes, the remote device doesn't acknowledge the LL_TERMINATE_IND
in time, requiring the controller to wait for the supervision timeout,
which may exceed 2 seconds. In the current implementation, the
HCI_EV_DISCONN_COMPLETE event is ignored if it arrives late, since
the hci_abort_conn_sync has cleaned up the connection after 2 seconds.
This causes the mgmt to get stuck, resulting in bluetoothd waiting
indefinitely for the mgmt response to the disconnect. To recover,
restarting bluetoothd is necessary.

bluetoothctl log like this:
[Designer Mouse]# disconnect D9:B5:6C:F2:51:91
Attempting to disconnect from D9:B5:6C:F2:51:91
[Designer Mouse]#
[Designer Mouse]# power off
[Designer Mouse]#
Failed to set power off: org.freedesktop.DBus.Error.NoReply.

Signed-off-by: Cheng Jiang [email protected]

include/net/bluetooth/hci_core.h | 2 ++
net/bluetooth/hci_conn.c | 9 +++++++++
net/bluetooth/hci_event.c | 9 +++++++++
net/bluetooth/hci_sync.c | 18 ++++++++++++++++++
4 files changed, 38 insertions(+)

base-commit: e25c8d66f6786300b680866c0e0139981273feba

Sometimes, the remote device doesn't acknowledge the LL_TERMINATE_IND
in time, requiring the controller to wait for the supervision timeout,
which may exceed 2 seconds. In the current implementation, the
HCI_EV_DISCONN_COMPLETE event is ignored if it arrives late, since
the hci_abort_conn_sync has cleaned up the connection after 2 seconds.
This causes the mgmt to get stuck, resulting in bluetoothd waiting
indefinitely for the mgmt response to the disconnect. To recover,
restarting bluetoothd is necessary.

bluetoothctl log like this:
[Designer Mouse]# disconnect D9:B5:6C:F2:51:91
Attempting to disconnect from D9:B5:6C:F2:51:91
[Designer Mouse]#
[Designer Mouse]# power off
[Designer Mouse]#
Failed to set power off: org.freedesktop.DBus.Error.NoReply.

Signed-off-by: Cheng Jiang <[email protected]>
Copy link

CheckPatch
Desc: Run checkpatch.pl script
Duration: 0.40 seconds
Result: PENDING

Copy link

GitLint
Desc: Run gitlint
Duration: 0.25 seconds
Result: PENDING

Copy link

SubjectPrefix
Desc: Check subject contains "Bluetooth" prefix
Duration: 0.07 seconds
Result: PASS

Copy link

BuildKernel
Desc: Build Kernel for Bluetooth
Duration: 25.14 seconds
Result: PASS

Copy link

CheckAllWarning
Desc: Run linux kernel with all warning enabled
Duration: 27.29 seconds
Result: PASS

Copy link

CheckSparse
Desc: Run sparse tool with linux kernel
Duration: 30.84 seconds
Result: WARNING
Output:

net/bluetooth/hci_event.c: note: in included file (through include/net/bluetooth/hci_core.h):

Copy link

BuildKernel32
Desc: Build 32bit Kernel for Bluetooth
Duration: 24.66 seconds
Result: PASS

Copy link

TestRunnerSetup
Desc: Setup kernel and bluez for test-runner
Duration: 437.78 seconds
Result: PASS

Copy link

TestRunner_l2cap-tester
Desc: Run l2cap-tester with test-runner
Duration: 20.72 seconds
Result: PASS

Copy link

TestRunner_iso-tester
Desc: Run iso-tester with test-runner
Duration: 30.18 seconds
Result: PASS

Copy link

TestRunner_bnep-tester
Desc: Run bnep-tester with test-runner
Duration: 4.86 seconds
Result: PASS

Copy link

TestRunner_mgmt-tester
Desc: Run mgmt-tester with test-runner
Duration: 122.69 seconds
Result: FAIL
Output:

Total: 490, Passed: 483 (98.6%), Failed: 3, Not Run: 4

Failed Test Cases
LL Privacy - Set Flags 1 (Add to RL)                 Failed       0.153 seconds
LL Privacy - Set Flags 3 (2 Devices to RL)           Failed       0.169 seconds
LL Privacy - Start Discovery 2 (Disable RL)          Failed       0.187 seconds

Copy link

TestRunner_rfcomm-tester
Desc: Run rfcomm-tester with test-runner
Duration: 7.66 seconds
Result: PASS

Copy link

TestRunner_sco-tester
Desc: Run sco-tester with test-runner
Duration: 9.40 seconds
Result: FAIL
Output:

BUG: KASAN: slab-use-after-free in hci_abort_conn_sync+0xc92/0xf30
Total: 15, Passed: 14 (93.3%), Failed: 0, Not Run: 1

Copy link

TestRunner_ioctl-tester
Desc: Run ioctl-tester with test-runner
Duration: 8.14 seconds
Result: PASS

Copy link

TestRunner_mesh-tester
Desc: Run mesh-tester with test-runner
Duration: 5.96 seconds
Result: PASS

Copy link

TestRunner_smp-tester
Desc: Run smp-tester with test-runner
Duration: 6.98 seconds
Result: PASS

Copy link

TestRunner_userchan-tester
Desc: Run userchan-tester with test-runner
Duration: 5.05 seconds
Result: PASS

Copy link

IncrementalBuild
Desc: Incremental build with the patches in the series
Duration: 0.72 seconds
Result: PENDING

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant