[PLAT-6316] Fix SIGSEGV in bsg_ksmachgetThreadQueueName #1065
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.
Goal
Fixes a crash that can occur in
bsg_ksmachgetThreadQueueName
Changeset
The
thread_identifier_info.dispatch_qaddr
can sometimes contain an invalid address, which will cause a crash if dereferenced. This is something that has been noted in the Crashlytics source code.bsg_ksmachcopyMem()
is now used to read the contents of the memory without causing a crash if invalid.Testing
I was not able to reproduce the crash, but manual testing and the E2E tests confirm that the function continues to return the expected queue name.