Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

[x86/Linux] Fix RtlRestoreContext #8916

Merged
merged 2 commits into from Jan 19, 2017

Conversation

parjong
Copy link

@parjong parjong commented Jan 12, 2017

The current implementation of RtlRestoreContext for x86/Linux is incorrect. which results in segfault discussed in #8887.

This commit re-implements RtlRestoreContext to resolve #8887.

@parjong
Copy link
Author

parjong commented Jan 12, 2017

\CC @seanshpark

push ecx
mov ecx, [eax + CONTEXT_Eax]
push ecx
push DWORD PTR [eax + CONTEXT_Edi]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we just load the registers from the context (doing the eax read as the last one) instead of pushing all of them and the popping?

Copy link
Member

@janvorli janvorli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

@parjong
Copy link
Author

parjong commented Jan 18, 2017

@janvorli Could you merge this PR if there is no further issue?

@janvorli
Copy link
Member

@parjong I am sorry for the delay. I just wish github had a button "merge after successful CI".

@janvorli janvorli merged commit a6dccc8 into dotnet:master Jan 19, 2017
@parjong parjong deleted the fix/RtlRestoreContext branch January 19, 2017 00:23
@karelz karelz modified the milestone: 2.0.0 Aug 28, 2017
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
* [x86/Linux] Fix RtlRestoreContext

* Use mov instead of push/pop


Commit migrated from dotnet/coreclr@a6dccc8
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
4 participants