Skip to content

Conversation

@github-actions
Copy link

@github-actions github-actions bot commented Aug 8, 2025

Backport 7f14815 from #3174.

L2CAP channels will now, along with the ident, store the opcode of the
pending request. This commit expands the ident lookup function to also
compare received response types to this opcode, and will ignore
unsolicited responses.

Setting of idents for channels are moved after verification of buffer
allocation for the request to be sent. A TODO is added for improving
this functionality at a later time.

Upstream PR #: 94080

Signed-off-by: Håvard Reierstad <[email protected]>
(cherry picked from commit 7f14815)
@HaavardRei HaavardRei added this to the ncs-3.1.0 milestone Aug 8, 2025
@alwa-nordic alwa-nordic requested a review from Copilot August 8, 2025 07:57
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR backports a security improvement that adds request/response validation to L2CAP (Logical Link Control and Adaptation Protocol) channels in the Bluetooth host stack. The change enhances the validation mechanism to match responses with their corresponding requests by tracking the pending request opcode.

  • Adds a new pending_req field to track the opcode of pending L2CAP requests
  • Updates the identifier lookup mechanism to validate both identifier and request opcode
  • Improves response validation by ensuring responses match the expected request type

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
subsys/bluetooth/host/l2cap.c Implements request/response validation by adding opcode tracking and updating lookup functions
include/zephyr/bluetooth/l2cap.h Adds pending_req field to bt_l2cap_le_chan structure for tracking request opcodes

@nordicjm nordicjm merged commit 0351d6e into ncs-v3.1-branch Aug 8, 2025
2 checks passed
@NordicBuilder
Copy link
Contributor

none

Note: This comment is automatically posted and updated by the Contribs GitHub Action.

@HaavardRei HaavardRei deleted the backport-3174-to-ncs-v3.1-branch branch August 8, 2025 10:23
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.

5 participants