Skip to content
Snippets Groups Projects
Commit 388c4889 authored by Brian Bosak's avatar Brian Bosak Committed by CQ bot account: commit-bot@chromium.org
Browse files

[zircon] Fix race conditions in Ethernet drivers

This patch fixes various race conditions and thread safety problems in
Ethernet/USB drivers.

It fixes the following problems:
* Allows for safe closure of an EthDev device from out-of-process
when transfers are still pending by adding a reference counting
mechanism.
* Adds static asserts to ensure that our alignment/padding assumptions
always hold true.
* Fixes a race condition in the CDC Ethernet drivers (both host
and peripheral side) where we were trying to talk to the core
driver after the core has been shutdown (use-after-free).
* Allocates the usb_cdc_t with new instead of calloc
and ensure that all members of the struct are properly initialized.
* Ensure that all transfers have finished before unbinding the
CDC Ethernet driver (both host and peripheral side).
* Ensure that it is impossible to queue a packet to a peripheral-side
USB bus when it is shut down.

FLK-152

Test: https://fuchsia-review.googlesource.com/c/fuchsia/+/272148/
Change-Id: Ic32a128ba3ba3eb09d1b60aeb744726aa9988d3c
parent f2a3de71
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment