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

[nrf fromlist] Bluetooth: ATT: lock scheduler when sending from user … #1556

Merged
merged 1 commit into from
Mar 7, 2024

Conversation

jori-nordic
Copy link
Contributor

…thread

att_req_send_process is not thread safe.

In the case where the current context is pre-emptible (e.g. when a user sends something over GATT from the main thread):

The iterator in att_req_send_process can get interrupted mid-processing, breaking the logic and resulting in an assert/crash/data corruption.

Additionally, the connection state check in this fn is also not thread-safe, the RX thread could pre-empt us and disconnect right before we attempt to send on an ATT bearer that is on it.

This is a hotfix until we have a generalized solution for the host API surface. It seems a lot of our logic assumes cooperative priority.

Upstream PR: zephyrproject-rtos/zephyr#69738

…thread

`att_req_send_process` is not thread safe.

In the case where the current context is pre-emptible (e.g. when a user
sends something over GATT from the main thread):

The iterator in `att_req_send_process` can get interrupted mid-processing,
breaking the logic and resulting in an assert/crash/data corruption.

Additionally, the connection state check in this fn is also not
thread-safe, the RX thread could pre-empt us and disconnect right before
we attempt to send on an ATT bearer that is on it.

This is a hotfix until we have a generalized solution for the host API
surface. It seems a lot of our logic assumes cooperative priority.

Upstream PR: zephyrproject-rtos/zephyr#69738

Signed-off-by: Jonathan Rico <[email protected]>
@jfischer-no jfischer-no merged commit 226b676 into nrfconnect:main Mar 7, 2024
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants