Fix USB transport io_service lifetime UAF and handshake stability#89
Merged
Fix USB transport io_service lifetime UAF and handshake stability#89
Conversation
- Keep io_service alive via shared ownership in Transport/TCPTransport/USBTransport to prevent late callback UAF during retry timers - Add bounded retry and rollback handling for USB receive interruptions/no-device transients - Make SSL global init one-time and avoid per-instance teardown - Fix AOAP descriptor lifetime by storing stable endpoint/interface values - Support SKIP_BUILD_PROTOBUF include path selection for system protobuf - Document USB receive retry corruption troubleshooting
- Create aasdk system group in postinst when missing - Set key permissions to root:aasdk with 640 mode - Align direct CMake install key permissions with group-read model
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes the heap-corruption/abort path triggered during Android Auto channel setup by addressing the underlying transport lifetime race and related stability issues.
Key fixes
io_servicealive via shared ownership in transport classes:Transportnow storesstd::shared_ptr<boost::asio::io_service>USBTransportandTCPTransportconstructors updated to use shared ownershipio_serviceLIBUSB_ERROR_NO_DEVICEand interrupted readsDataSinkfill slots before retry re-armstd::call_onceSKIP_BUILD_PROTOBUF=ON(system protobuf)Validation
aasdkdebug and ASAN variants successfullyUSBTransport::scheduleReceiveRetrycrankshaft-corerebuilt cleanly against updated headers and linked successfullyNotes
This targets
developas requested.