commit | 9c7b530a36e70f81a780b3e36a8522c55afa9ade | [log] [tgz] |
---|---|---|
author | Austin Foxley <afoxley@google.com> | Mon Feb 24 16:01:17 2025 -0800 |
committer | CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com> | Mon Feb 24 16:01:17 2025 -0800 |
tree | 4c1d8cdf44b140e2b0ebabda47d91933ca7b47ea | |
parent | 56fe85e93e5de57dc17a777e7fce833e7a50a243 [diff] |
pw_bluetooth_proxy: Hold channels lock while using L2capChannel Fixes use-after-free and data race issues that can happen when accessing an L2capChannel* that may already have been removed and deleted. Return a locked wrapper when looking up a channel that should be held while accessing. Fix the resulting deadlocks via two approaches: - Introduce Locked variants so code that needs to access channel list further down the stack can do so without taking the lock. - Defer queue drain via a flag so channels that need to send during their receive processing (for instance, to replenish credits) can signal that. Then for each receieved packet we check the flag, as well as on any external writes. Bug: 390511432 Change-Id: Ia319c227a02e2d4b52113d3c2dbf091e4dde256e Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/270418 Lint: Lint 🤖 <android-build-ayeaye@system.gserviceaccount.com> Commit-Queue: Auto-Submit <auto-submit@pigweed-service-accounts.iam.gserviceaccount.com> Docs-Not-Needed: Austin Foxley <afoxley@google.com> Presubmit-Verified: CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: David Rees <drees@google.com>
Pigweed is an open source collection of embedded-targeted libraries–or as we like to call them, modules. These modules are building blocks and infrastructure that enable faster and more reliable development on small-footprint MMU-less 32-bit microcontrollers like the STMicroelectronics STM32L452 or the Nordic nRF52832.
For more information please see our website: https://pigweed.dev/.