This repository was archived by the owner on Jan 23, 2023. It is now read-only.
[x86/Linux] Fix segmentation fault during GSCookie check (WIP)#8981
Closed
parjong wants to merge 1 commit into
Closed
[x86/Linux] Fix segmentation fault during GSCookie check (WIP)#8981parjong wants to merge 1 commit into
parjong wants to merge 1 commit into
Conversation
janvorli
suggested changes
Jan 18, 2017
|
|
||
| do | ||
| { | ||
| CONTEXT currentContext = *frameContext; |
Member
There was a problem hiding this comment.
We should not change anything in this function, but rather fix it for x86 elsewhere. This function works for amd64 and arm, so it should be possible to ensure that it works for x86 too.
One of the problems here is that you set the dispatcherContext.ContextRecord to a local variable address, but the ProcessCLRException stores it in the ExceptionTracker that outlives this function.
This is the reason why 65 tests have failed in the CI.
Member
|
@parjong could you please dump me the call stack when the cookie check has seg faulted? |
Author
|
@janvorli As you pointed out, it seems that this PR is not appropriate. I'll close this PR, and re-submit later with right fix. |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This commit attempts to fix segfault due to incorrect GSCookie address.
The current implementation computes GSCookie address via dereferencing pEbp field in REGDISPLAY, and adding some offsets, but pEbp is not initialized correctly.
This results in segmentation fault discussed in #8980.
In addition, the currenct implementation of FaultingExceptionFrame::UpdateRegDisplay does not updates pXXX fields at all, which incurs segmentation fault while checking GSCookie inside ExceptionTracker::FindNonvolatileRegisterPointers .
This commit attempts to update pEbp to fix #8980.