Skip to content

[Backport 9.0] [IIS] Manually parse exe bitness (#61894) #62038

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

Open
wants to merge 1 commit into
base: release/9.0
Choose a base branch
from

Conversation

BrennanConroy
Copy link
Member

Backport of #61894

[IIS] Manually parse exe bitness

Description

In the AspNetCoreModule for IIS we have a check that dotnet.exe is the same architecture as the worker process (w3wp.exe). We used the windows function GetBinaryTypeW to determine this information, which while correct has raised some concerns since it loads the exe into executable space.

This PR changes the code to manually parse the exe file headers which is a well known format and use that information for the bitness check. This avoids loading the exe in executable space and still lets us check that the bitness matches.

Customer Impact

We unnecessarily load the specified exe into executable space.

Regression?

  • Yes
  • No

Risk

  • High
  • Medium
  • Low

Updating a non-critical check, so if it checks incorrectly it will only result in slightly worse program diagnosability on app run failure. Also did a bunch of testing on the code to make sure it shouldn't be possible to throw which would be problematic.

Verification

  • Manual (required)
  • Automated

Packaging changes reviewed?

  • Yes
  • No
  • N/A

@BrennanConroy BrennanConroy added this to the 9.0.x milestone May 20, 2025
@BrennanConroy BrennanConroy added the Servicing-consider Shiproom approval is required for the issue label May 20, 2025
@BrennanConroy BrennanConroy added the feature-iis Includes: IIS, ANCM label May 20, 2025
@BrennanConroy BrennanConroy requested a review from mgravell as a code owner May 20, 2025 23:22
@BrennanConroy BrennanConroy added area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions Servicing-approved Shiproom has approved the issue and removed Servicing-consider Shiproom approval is required for the issue labels May 20, 2025
Copy link
Contributor

Hi @@BrennanConroy. This PR was just approved to be included in the upcoming servicing release. Somebody from the @dotnet/aspnet-build team will get it merged when the branches are open. Until then, please make sure all the CI checks pass and the PR is reviewed.

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 feature-iis Includes: IIS, ANCM Servicing-approved Shiproom has approved the issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants