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

[Backport v2.7-branch] Bluetooth: Host: Check returned value by LE_READ_BUFFER_SIZE #55022

Merged
merged 1 commit into from
Feb 25, 2023

Conversation

theob-pro
Copy link
Contributor

@theob-pro theob-pro commented Feb 21, 2023

Fixes #55019

rp->le_max_num was passed unchecked into k_sem_init(), this could lead to the value being uninitialized and an unknown behavior.

To fix that issue, the rp->le_max_num value is checked the same way as bt_dev.le.acl_mtu was already checked. The same things has been done for rp->acl_max_num and rp->iso_max_num in
read_buffer_size_v2_complete() function.

(cherry picked from commit ac3dec5)

@jhedberg jhedberg changed the title Bluetooth: Host: Check returned value by LE_READ_BUFFER_SIZE [Backport v2.7-branch] Bluetooth: Host: Check returned value by LE_READ_BUFFER_SIZE Feb 21, 2023
`rp->le_max_num` was passed unchecked into `k_sem_init()`, this could
lead to the value being uninitialized and an unknown behavior.

To fix that issue, the `rp->le_max_num` value is checked the same way as
`bt_dev.le.acl_mtu` was already checked. The same things has been done
for `rp->acl_max_num` and `rp->iso_max_num` in
`read_buffer_size_v2_complete()` function.

Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
(cherry picked from commit ac3dec5)
@cfriedt cfriedt merged commit c3f512d into v2.7-branch Feb 25, 2023
@nashif nashif deleted the backport-54905-to-v2.7-branch branch February 13, 2024 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

5 participants