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

BLE: Fix access to attcCb.onDeck and attsCb.prepWriteQueue access #13785

Merged
merged 2 commits into from
Oct 20, 2020

Conversation

pan-
Copy link
Member

@pan- pan- commented Oct 19, 2020

Summary of changes

This PR fixes invalid array accesses in the cordio gatt server and gatt client. The structures attcCb_t and attsCb_t have both an array to store outstanding requests. An entry in the array is reserved for each connection pre allocated.

These arrays were accessed by connection ID which is incorrect as connection ID starts at 1, not 0.

The fix is to subtract 1 to the connection id to get the correct index, this is done in other part of the code but wasn't for these two arrays.

The bug is not visible in mbed os if there is less than 3 concurrent connections but it shows up if there's as many concurrent connections as the maximum number provisioned at compile time: The GattServer services are then removed at the end of the connection.

Impact of changes

Migration actions required

None

Documentation

None


Pull request type

[x] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results

[x] No Tests required for this change (E.g docs only update)
[] Covered by existing mbed-os tests (Greentea or Unittest)
[] Tests / results supplied as part of this PR

Reviewers


The connection id starts at the value 1. The entry accessed in the array should be connId - 1
The connection starts at 1, not 0. The entry in the array should be connId - 1
@ciarmcom ciarmcom added the release-type: patch Indentifies a PR as containing just a patch label Oct 19, 2020
@ciarmcom ciarmcom requested a review from a team October 19, 2020 17:00
@ciarmcom
Copy link
Member

@pan-, thank you for your changes.
@ARMmbed/mbed-os-maintainers please review.

Copy link
Member

@paul-szczepanek-arm paul-szczepanek-arm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am shocked, shocked to find there's gambling going on in here!

@0xc0170
Copy link
Contributor

0xc0170 commented Oct 20, 2020

CI started

@mergify mergify bot added needs: CI and removed needs: review labels Oct 20, 2020
@mbed-ci
Copy link

mbed-ci commented Oct 20, 2020

Jenkins CI Test : ✔️ SUCCESS

Build Number: 1 | 🔒 Jenkins CI Job | 🌐 Logs & Artifacts

CLICK for Detailed Summary

jobs Status
jenkins-ci/mbed-os-ci_unittests ✔️
jenkins-ci/mbed-os-ci_build-example-ARM ✔️
jenkins-ci/mbed-os-ci_build-cloud-example-ARM ✔️
jenkins-ci/mbed-os-ci_build-greentea-ARM ✔️
jenkins-ci/mbed-os-ci_build-cloud-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_build-greentea-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_build-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_dynamic-memory-usage ✔️
jenkins-ci/mbed-os-ci_greentea-test ✔️
jenkins-ci/mbed-os-ci_cloud-client-pytest ✔️

@0xc0170 0xc0170 merged commit 27d1050 into ARMmbed:master Oct 20, 2020
@mergify mergify bot removed the ready for merge label Oct 20, 2020
@mbedmain mbedmain added release-version: 6.4.0 Release-pending and removed release-type: patch Indentifies a PR as containing just a patch Release-pending labels Oct 20, 2020
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.

None yet

7 participants