Skip to content

Conversation

theob-pro
Copy link
Contributor

@theob-pro theob-pro commented Feb 16, 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.

@theob-pro theob-pro changed the title Bluetooth: Host: Fix security issue from invalid init in hci_core.c Bluetooth: Host: Check returned value by LE_READ_BUFFER_SIZE Feb 16, 2023
@theob-pro theob-pro force-pushed the fix-invalid-init-of-le-read-buffer-size-complete branch 7 times, most recently from 446b331 to 13b314c Compare February 17, 2023 09:49
@stephanosio stephanosio added this to the v3.3.0 milestone Feb 17, 2023
@theob-pro theob-pro force-pushed the fix-invalid-init-of-le-read-buffer-size-complete branch from 13b314c to a42cbea Compare February 17, 2023 10:58
@theob-pro theob-pro force-pushed the fix-invalid-init-of-le-read-buffer-size-complete branch 2 times, most recently from 775a393 to 6f42f9c Compare February 17, 2023 13:13
jhedberg
jhedberg previously approved these changes Feb 17, 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 <[email protected]>
@theob-pro theob-pro force-pushed the fix-invalid-init-of-le-read-buffer-size-complete branch from 6f42f9c to e8b9db7 Compare February 17, 2023 13:14
@stephanosio stephanosio requested a review from jhedberg February 17, 2023 13:39
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