ports/target: don't crash on transport to an uninitialized bridge#84
Open
Matheus Tavares Bernardino @ Qualcomm (quic-mathbern) wants to merge 1 commit into
Conversation
A QemuTargetSocket's bridge is only wired up to its QEMU instance once init()/init_with_mr() runs. Before that, m_inst is null and the socket cannot service a transaction. Nothing stops a transaction from arriving early, though: a gs::loader loads its image at end_of_elaboration, and that access can be routed by the router to a bridge that hasn't been initialized yet. b_transport then dereferences the null m_inst and segfaults. Bail out early with TLM_OK_RESPONSE when the bridge is uninitialized so the access is a harmless no-op instead of a crash. Signed-off-by: Matheus Tavares Bernardino <matheus.bernardino@oss.qualcomm.com>
Contributor
Author
|
CC (For some reason, I'm not allowed to ask for reviews) |
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.
A QemuTargetSocket's bridge is only wired up to its QEMU instance once
init()/init_with_mr() runs. Before that, m_inst is null and the socket
cannot service a transaction.
Nothing stops a transaction from arriving early, though: a gs::loader
loads its image at end_of_elaboration, and that access can be routed by
the router to a bridge that hasn't been initialized yet. b_transport
then dereferences the null m_inst and segfaults.
Bail out early with TLM_OK_RESPONSE when the bridge is uninitialized so
the access is a harmless no-op instead of a crash.
Signed-off-by: Matheus Tavares Bernardino matheus.bernardino@oss.qualcomm.com