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

Fix pRequestInfo INVALID_POINTER_READ caused by GCs #50446

Merged

Conversation

NGloreous
Copy link
Contributor

@NGloreous NGloreous commented Aug 31, 2023

Fix pRequestInfo INVALID_POINTER_READ caused by GCs

  • You've read the Contributor Guide and Code of Conduct.
  • You've included unit or integration tests for your change, where applicable.
  • You've included inline docs for your change, where applicable.
  • There's an open issue for the PR that you are making. If you'd like to propose a new feature or change, please open an issue to discuss the change or find an existing issue.

Description

When using the IHttpSysRequestInfoFeature it's possible to hit invalid pointer read errors which causes a process crash. It's also possible to hit other issue caused by the invalid pointer. The error occurs when a GC moves to memory of the request's _backingBuffer before trying to access the RequestInfo property of IHttpSysRequestInfoFeature.

The fix is to adjust the pRequestInfo pointer similar to how other pointers in this class are adjusted.

Fixes #50445

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions label Aug 31, 2023
@ghost ghost added the community-contribution Indicates that the PR has been added by a community member label Aug 31, 2023
@ghost
Copy link

ghost commented Aug 31, 2023

Thanks for your PR, @NGloreous. Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@Tratcher Tratcher self-assigned this Aug 31, 2023
@Tratcher
Copy link
Member

Once merged this will also need to be backported to release/8.0. There's a bot we can use for that.

@Tratcher Tratcher added this to the 9.0-preview1 milestone Aug 31, 2023
@Tratcher Tratcher merged commit 405577a into dotnet:main Aug 31, 2023
26 checks passed
@Tratcher
Copy link
Member

/backport to release/8.0

@github-actions
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Crash due to INVALID_POINTER_READ NativeRequestContext.GetRequestInfo
4 participants