Skip to content

[Backport v4.3-branch] Bluetooth: HCI: psoc6_bless: Make the TX packet info a local variable - #117349

Open
github-actions[bot] wants to merge 1 commit into
v4.3-branchfrom
backport-116647-to-v4.3-branch
Open

[Backport v4.3-branch] Bluetooth: HCI: psoc6_bless: Make the TX packet info a local variable#117349
github-actions[bot] wants to merge 1 commit into
v4.3-branchfrom
backport-116647-to-v4.3-branch

Conversation

@github-actions

Copy link
Copy Markdown

Backport 7d0efa3 from #116647.

Original PR description:


hci_tx_pkt is a file-scope variable, but psoc6_bless_send() clears and populates it before taking psoc6_bless_operation_sem, so two senders can overwrite each other's packet information, and the one holding the semaphore can end up handing the controller a packet that describes the other buffer.

Nothing else uses the variable, and it does not need to outlive the call: Cy_BLE_SoftHciSendAppPkt() copies the packet into the controller's buffer before returning, as documented in cy_ble_stack.h. Make it a local variable, which removes the shared state instead of locking it.

Compile tested only (no hardware): samples/bluetooth/peripheral_hr for cy8cproto_063_ble.

Fixes: #117347

hci_tx_pkt is a file-scope variable, but psoc6_bless_send() clears and
populates it before taking psoc6_bless_operation_sem, so two senders
can overwrite each other's packet information, and the one holding the
semaphore can end up handing the controller a packet that describes the
other buffer.

Nothing else uses the variable, and it does not need to outlive the
call: Cy_BLE_SoftHciSendAppPkt() copies the packet into the
controller's buffer before returning, as documented in cy_ble_stack.h.
Make it a local variable, which removes the shared state instead of
locking it.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
(cherry picked from commit 7d0efa3)
@github-actions github-actions Bot added the Backport Backport PR and backport failure issues label Aug 25, 2026
@github-project-automation github-project-automation Bot moved this to To do in Backports Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Backport Backport PR and backport failure issues

Projects

Status: To do

Development

Successfully merging this pull request may close these issues.

1 participant