Skip to content

Fix write behind allocated memory in thread name setting - #34424

Merged
janvorli merged 1 commit into
dotnet:masterfrom
janvorli:fix-thread-name-setting-memory-overwrite
Apr 2, 2020
Merged

Fix write behind allocated memory in thread name setting#34424
janvorli merged 1 commit into
dotnet:masterfrom
janvorli:fix-thread-name-setting-memory-overwrite

Conversation

@janvorli

@janvorli janvorli commented Apr 1, 2020

Copy link
Copy Markdown
Member

The code in CorUnix::InternalSetThreadDescription is writing behind
the end of the allocated memory in case the name is shorter than 16
characters. That is causing memory heap corruption.

The problem was discovered in dotnet/installer#6876

The code in CorUnix::InternalSetThreadDescription is writing behind
the end of the allocated memory in case the name is shorter than 16
characters. That is causing memory heap corruption.
@janvorli janvorli added the area-PAL-coreclr only for closed issues label Apr 1, 2020
@janvorli janvorli added this to the 5.0 milestone Apr 1, 2020
@janvorli
janvorli requested a review from jkotas April 1, 2020 21:03
@janvorli janvorli self-assigned this Apr 1, 2020
@janvorli

janvorli commented Apr 1, 2020

Copy link
Copy Markdown
Member Author

cc: @mmitche

@mmitche

mmitche commented Apr 1, 2020

Copy link
Copy Markdown
Member

Thanks! I'll port this to preview3 once this fix is finalized

@janvorli
janvorli merged commit c03c529 into dotnet:master Apr 2, 2020
@janvorli
janvorli deleted the fix-thread-name-setting-memory-overwrite branch April 2, 2020 00:57
mmitche pushed a commit to mmitche/runtime that referenced this pull request Apr 2, 2020
The code in CorUnix::InternalSetThreadDescription is writing behind
the end of the allocated memory in case the name is shorter than 16
characters. That is causing memory heap corruption.
mmitche added a commit that referenced this pull request Apr 2, 2020
…4437)

The code in CorUnix::InternalSetThreadDescription is writing behind
the end of the allocated memory in case the name is shorter than 16
characters. That is causing memory heap corruption.

Co-authored-by: Jan Vorlicek <janvorli@microsoft.com>
@ghost ghost locked as resolved and limited conversation to collaborators Dec 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-PAL-coreclr only for closed issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants