Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[metadata] Fix use after free of signatures of some dynamic methods #9863

Merged
merged 2 commits into from
Aug 6, 2018

Conversation

BrzVlad
Copy link
Member

@BrzVlad BrzVlad commented Aug 2, 2018

No description provided.

When freeing dynamic methods in mono_free_method, we remove entries in the method image's hashtables, hashed by the soon to be freed method signature.
@BrzVlad BrzVlad changed the title [metadata] Fix sig dynamic crash [metadata] Fix use after free of signatures of some dynamic methods Aug 2, 2018
@lewurm
Copy link
Contributor

lewurm commented Aug 3, 2018

looks good. why is it needed?

@BrzVlad
Copy link
Member Author

BrzVlad commented Aug 3, 2018

@lewurm this crash happens on the interp System.core xunit, when rehashing some tables. It could also happen in theory with default mono though.

@lewurm lewurm merged commit 60643fc into mono:master Aug 6, 2018
alexanderkyte pushed a commit to alexanderkyte/mono that referenced this pull request Aug 16, 2018
…ono#9863)

* [metadata] Cache method signature in correct image hash

When freeing dynamic methods in mono_free_method, we remove entries in the method image's hashtables, hashed by the soon to be freed method signature.

* [metadata] Avoid unnecessary alloc
UnityAlex added a commit to Unity-Technologies/mono that referenced this pull request Sep 22, 2020
…rypick cleanly:

7869333
mono#9863
f265d9a

Needed in order to fix corruption that was occuring to mscorlib's image table on domain reload due to dynamic methods from other images being stored in a hashtable that was not being cleaned up on domain reload.
UnityAlex added a commit to Unity-Technologies/mono that referenced this pull request Oct 22, 2020
…rypick cleanly:

7869333
mono#9863
f265d9a

Needed in order to fix corruption that was occuring to mscorlib's image table on domain reload due to dynamic methods from other images being stored in a hashtable that was not being cleaned up on domain reload.
ramanbs-rythmos pushed a commit to Unity-Technologies/mono that referenced this pull request Oct 28, 2020
…rypick cleanly:

7869333
mono#9863
f265d9a

Needed in order to fix corruption that was occuring to mscorlib's image table on domain reload due to dynamic methods from other images being stored in a hashtable that was not being cleaned up on domain reload.
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
…ono/mono#9863)

* [metadata] Cache method signature in correct image hash

When freeing dynamic methods in mono_free_method, we remove entries in the method image's hashtables, hashed by the soon to be freed method signature.

* [metadata] Avoid unnecessary alloc


Commit migrated from mono/mono@60643fc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants